クラス DLAModel

java.lang.Object
  上位を拡張 DLAModel

public class DLAModel
extends java.lang.Object

DLA フラクタルモデル


フィールドの概要
protected  int bgColor
          背景色の RGB 値
protected  int height
          画面高さ
protected  int movingCount
          活動中の粒子の数
protected  int onColor
          凝集体表示色の RGB 値
protected  Particle[] p
          粒子を格納した配列
protected  int particleCount
          粒子の数
protected  int pColor
          浮遊粒子表示色の RGB 値
protected  int[] pixel
          画面ピクセルを格納した配列
protected  java.util.Random random
          乱数ジェネレーター
protected  int width
          画面幅
 
コンストラクタの概要
DLAModel(int width, int height)
          DLA フラクタルモデルを構築する
DLAModel(int width, int height, int seed)
          DLA フラクタルモデルを構築する
 
メソッドの概要
protected  boolean checkAdd(int point, Particle p)
          粒子が凝集するかどうか判定する
 int[] getPixel()
          画面ピクセルを返す
private  void init()
          データを初期化する
 boolean isFinished()
          計算が完了したかどうかを判別する
 void next()
          次のステップを計算する
protected  int point(Particle p)
          粒子位置ポインタを返す
protected  void randomWalk(Particle p)
          ランダムウォークの計算をする
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

width

protected int width
画面幅


height

protected int height
画面高さ


particleCount

protected int particleCount
粒子の数


movingCount

protected int movingCount
活動中の粒子の数


pixel

protected int[] pixel
画面ピクセルを格納した配列


p

protected Particle[] p
粒子を格納した配列


bgColor

protected int bgColor
背景色の RGB 値


onColor

protected int onColor
凝集体表示色の RGB 値


pColor

protected int pColor
浮遊粒子表示色の RGB 値


random

protected java.util.Random random
乱数ジェネレーター

コンストラクタの詳細

DLAModel

public DLAModel(int width,
                int height)
DLA フラクタルモデルを構築する

パラメータ:
width - 画面幅
height - 画面高さ

DLAModel

public DLAModel(int width,
                int height,
                int seed)
DLA フラクタルモデルを構築する

パラメータ:
width - 画面幅
height - 画面高さ
seed - 擬似乱数の種
メソッドの詳細

init

private void init()
データを初期化する


getPixel

public int[] getPixel()
画面ピクセルを返す

戻り値:
画面ピクセルを格納した配列

isFinished

public boolean isFinished()
計算が完了したかどうかを判別する

戻り値:
計算が完了した場合は true

next

public void next()
次のステップを計算する


randomWalk

protected void randomWalk(Particle p)
ランダムウォークの計算をする

パラメータ:
p - ランダムウォークをさせる粒子

checkAdd

protected boolean checkAdd(int point,
                           Particle p)
粒子が凝集するかどうか判定する

パラメータ:
point - 粒子位置ポインタ
p - 判定対象の粒子
戻り値:
粒子が凝集する場合は true

point

protected int point(Particle p)
粒子位置ポインタを返す

パラメータ:
p - 粒子
戻り値:
粒子位置ポインタ