クラス PatternSpace

java.lang.Object
  拡張swarm.BaseImpl
      拡張swarm.space.Discrete2dImpl
          拡張PatternSpace
すべての実装インタフェース:
swarm.defobj.Create, swarm.defobj.CreateS, swarm.defobj.Customize, swarm.defobj.CustomizeS, swarm.defobj.DefinedObject, swarm.defobj.DefinedObjectS, swarm.space.Discrete2d, swarm.space.Discrete2dS, swarm.defobj.Drop, swarm.defobj.DropS, swarm.defobj.GetName, swarm.defobj.GetNameS, swarm.space.GridData, swarm.space.GridDataS, swarm.objectbase.SwarmObject, swarm.objectbase.SwarmObjectS

public class PatternSpace
extends swarm.space.Discrete2dImpl


フィールドの概要
(パッケージプライベート)  boolean[][] checked
           
(パッケージプライベート)  java.util.LinkedList clusterData
           
(パッケージプライベート)  java.util.LinkedList clusterSizeData
           
(パッケージプライベート)  int height
           
(パッケージプライベート)  java.util.LinkedList largestCluster
           
(パッケージプライベート)  java.util.LinkedList remainingPoints
           
(パッケージプライベート)  int width
           
 
クラス swarm.BaseImpl から継承したフィールド
 
コンストラクタの概要
PatternSpace(swarm.defobj.Zone aZone, int W, int H)
           
 
メソッドの概要
 int getClusterNum()
           
 java.util.LinkedList getClusterSizeData()
           
 double getPercolationProb()
          浸透確率を計算する。
(パッケージプライベート)  void initializeSpace()
          コンストラクタの補助メソッド
 boolean remainingQ()
          まだ点の置かれていない格子があるか
 void trace()
          クラスタに分ける処理を行うメソッド
・はじめ、すべての点はunchecked
・点を順番に調べていく
・uncheckedの点につながっている点を再帰的に調べる(traceCluster)
・できあがったclusterDataの中で、最大のものが最大クラスタ

これは再帰的な処理だが、もちろん反復でもできる。
(パッケージプライベート)  void traceCluster(int i, int j, int ci)
          traceの補助メソッド
 void update()
          PatternSpaceに新しい点をランダムに追加する。
 
クラス swarm.space.Discrete2dImpl から継承したメソッド
compare, copyDiscrete2d$toDiscrete2d, describe, describeID, drop, fastFillWithObject, fastFillWithValue, fillWithObject, fillWithValue, getCompleteProbeMap, getDisplayName, getName, getObjectAtX$Y, getProbeForMessage, getProbeForVariable, getProbeMap, getSizeX, getSizeY, getTypeName, getValueAtX$Y, getZone, perform, perform$with, perform$with$with, perform$with$with$with, putObject$atX$Y, putValue$atX$Y, respondsTo, setDiscrete2d$toFile, setDisplayName, xfprint, xfprintid, xprint, xprintid
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

width

int width

height

int height

remainingPoints

java.util.LinkedList remainingPoints

largestCluster

java.util.LinkedList largestCluster

clusterData

java.util.LinkedList clusterData

clusterSizeData

java.util.LinkedList clusterSizeData

checked

boolean[][] checked
コンストラクタの詳細

PatternSpace

public PatternSpace(swarm.defobj.Zone aZone,
                    int W,
                    int H)
メソッドの詳細

initializeSpace

void initializeSpace()
コンストラクタの補助メソッド


remainingQ

public boolean remainingQ()
まだ点の置かれていない格子があるか


update

public void update()
PatternSpaceに新しい点をランダムに追加する。
ここではクラスタリングの計算は行わない。 この計算は重いと予想されるため、getPercolationProbが呼ばれたときのみ行う。


trace

public void trace()
クラスタに分ける処理を行うメソッド
・はじめ、すべての点はunchecked
・点を順番に調べていく
・uncheckedの点につながっている点を再帰的に調べる(traceCluster)
・できあがったclusterDataの中で、最大のものが最大クラスタ

これは再帰的な処理だが、もちろん反復でもできる。
参考:小田垣孝「パーコレーションの科学」第3章


traceCluster

void traceCluster(int i,
                  int j,
                  int ci)
traceの補助メソッド


getPercolationProb

public double getPercolationProb()
浸透確率を計算する。
内部で、PatternSpaceに最大クラスタサイズを問い合わせ、 その結果と、全格子数の比が浸透確率である。


getClusterSizeData

public java.util.LinkedList getClusterSizeData()

getClusterNum

public int getClusterNum()