|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object blog.BasicVar blog.VarWithDistrib blog.NumberVar
public class NumberVar
A number random variable. It consists of a potential object pattern (POP) and a tuple of generating objects. Its value in a given world is the number of objects generated by that POP and those generating objects.
Field Summary |
---|
Fields inherited from class blog.BasicVar |
---|
args |
Constructor Summary | |
---|---|
NumberVar(POP pop,
java.util.List args)
Creates a new NumberVar for the given POP and given tuple of generating objects. |
|
NumberVar(POP pop,
java.lang.Object[] args)
Creates a new NumberVar for the given POP and given tuple of generating objects. |
|
NumberVar(POP pop,
java.lang.Object[] args,
boolean stable)
Creates a new NumberVar for the given POP and given tuple of generating objects. |
Method Summary | |
---|---|
java.lang.Object |
clone()
|
boolean |
equals(java.lang.Object obj)
Two NumberVar objects are equal if they have the same POP and their argument lists are equal (recall that list equality is checked by calling the equals method on each
corresponding pair of objects in the two lists). |
DependencyModel |
getDepModel()
Returns the dependency model for this variable. |
DependencyModel.Distrib |
getDistrib(EvalContext context)
Returns the CPD and argument values in the first satisfied clause of this variable's dependency statement in the given context. |
int |
getOrderingIndex()
Returns an index to be used for comparing this variable to others. |
java.lang.Object |
getOriginFuncValue(OriginFunction g)
Returns the value that the given origin function yields on all objects that satisfy this number variable. |
Type |
getType()
Returns the integer type. |
int |
hashCode()
|
int |
numGenerated(PartialWorld w)
Returns the number of objects generated by this POP on this tuple of generating objects in the given world. |
POP |
pop()
Returns the potential object pattern associated with this number variable. |
java.lang.String |
toString()
Returns a string of the form #Type(f1 = o1, ..., fK = oK) where f1, ..., fK are the origin functions and o1, ..., oK are the generating objects. |
Methods inherited from class blog.VarWithDistrib |
---|
ensureDetAndSupported, getFirstUninstParent, getParents |
Methods inherited from class blog.BasicVar |
---|
args, compareTo, ensureStable, getCanonicalTerm, getCanonicalTerm, getValue, isDetermined, timestep |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public NumberVar(POP pop, java.util.List args)
public NumberVar(POP pop, java.lang.Object[] args)
public NumberVar(POP pop, java.lang.Object[] args, boolean stable)
stable
is true, then the
caller guarantees that the given args
array will not
be modified externally.
Method Detail |
---|
public final POP pop()
public DependencyModel.Distrib getDistrib(EvalContext context)
VarWithDistrib
getDistrib
in class VarWithDistrib
public Type getType()
getType
in class BasicVar
public int getOrderingIndex()
BasicVar
getOrderingIndex
in class BasicVar
public DependencyModel getDepModel()
VarWithDistrib
getDepModel
in class VarWithDistrib
public java.lang.Object getOriginFuncValue(OriginFunction g)
java.lang.IllegalArgumentException
- if the argument type of the given
origin function is not the type
of objects that satisfy this variablepublic int numGenerated(PartialWorld w)
public java.lang.Object clone()
clone
in class BasicVar
public boolean equals(java.lang.Object obj)
equals
method on each
corresponding pair of objects in the two lists).
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |