Class LayerProb

java.lang.Object
  |
  +--FileDefaultable
        |
        +--Layer
              |
              +--LayerProb
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, java.io.Serializable

public class LayerProb
extends Layer

A layer that decides at random if it contains an object.

See Also:
Serialized Form

Field Summary
(package private)  double prob
          The probability that the layer includes an object.
private static long serialVersionUID
           
 
Fields inherited from class Layer
all, ALL, defaults, file, fixed, mindefaults, name, none, NONE
 
Fields inherited from class FileDefaultable
curfile, defmap, filemap, fixedmap, minmap
 
Constructor Summary
(package private) LayerProb(double prob)
          Build a layer including an object with a given probability.
 
Method Summary
 java.lang.Object clone()
          Make a copy of this Layer.
 void copy(FileDefaultable thatitem)
          Copy the value of another ProbLayer into this.
 boolean isMember(java.lang.Object target)
          True with probability prob.
 
Methods inherited from class Layer
edit, getName, readResolve
 
Methods inherited from class FileDefaultable
absorb, add, check, checkAll, cloneSet, compareTo, equals, getAll, getAll, getArray, getDefs, getExisting, getFile, getFixed, getGlobal, getMin, lookup, lookup, mergeDelete, mergeFile, seperate, sortOut, toString, toSuperString
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID

prob

double prob
The probability that the layer includes an object.

Constructor Detail

LayerProb

LayerProb(double prob)
Build a layer including an object with a given probability.

Method Detail

clone

public java.lang.Object clone()
Make a copy of this Layer.

Overrides:
clone in class Layer

copy

public void copy(FileDefaultable thatitem)
Copy the value of another ProbLayer into this.

Overrides:
copy in class Layer

isMember

public boolean isMember(java.lang.Object target)
True with probability prob. It is not guaranteed that a given object will get the same result each time. Successive calls are (nearly) independant

Overrides:
isMember in class Layer