|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectp3j.pppm.sets.Set
public class Set
Represents a set in PPPM. A set is associated with a certain SetType
,
which defines for which ParameterInstance
objects this set may define
eligible ParameterAssignment
objects. A set has a certain probability
of occurrence and will be randomly chosen from a list with all sets
associated with the same SetType
. If it is chosen, for each
ParameterInstance
that is defined by its SetType
one
ParameterAssignment
from this Set
will be chosen randomly
(so, there are two levels of random choosing, one in the SetType
, one
in the Set
). The eligible ParameterAssignment
objects are
stored in a Map
, there is a List
for each
ParameterInstance
.
See documentation of SetType
for more information.
Created on August 7, 2006
Constructor Summary | |
---|---|
Set()
Constructor for bean compatibility. |
|
Set(List<ParameterInstance> definedParameters,
String setName,
String desc,
double prob)
Default constructor. |
Method Summary | |
---|---|
void |
addParameterAssignment(ParameterAssignment paramAssign)
Adds a new parameter assignment. |
void |
addParameterInstance(ParameterInstance parameterInstance)
Adds a parameter instance to the set. |
String |
getDescription()
|
int |
getID()
|
String |
getName()
|
int |
getNumberOfAssignments(ParameterInstance instance)
Retrieve the number of eligible ParameterAssignment objects for a
given ParameterInstance . |
ParameterAssignmentSet |
getParameterAssignments(ParameterInstance paramInstance)
Get eligible ParameterAssignment objects for given
ParameterInstance . |
double |
getProbability()
Get the probability that this entity will be chosen. |
Map<ParameterInstance,ParameterAssignmentSet> |
getSetData()
|
boolean |
isValid()
Checks whether this set contains at least one assignment for every parameter instance. |
void |
removeParameterAssignment(ParameterAssignment paramAssign)
Removes a parameter assignment. |
ParameterAssignmentSet |
removeParameterInstance(ParameterInstance parameterInstance)
Removes a parameter instance from the set. |
void |
setDescription(String description)
|
void |
setID(int uniqueID)
|
void |
setName(String name)
|
void |
setProbability(double probability)
Set probability for being chosen. |
protected void |
setProblemOccurred(ParameterAssignment assignment)
Throws a RuntimeException reporting on problems while processing a
ParameterAssignment . |
void |
setSetData(Map<ParameterInstance,ParameterAssignmentSet> setData)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Set(List<ParameterInstance> definedParameters, String setName, String desc, double prob)
definedParameters
- set of parameter instances for which this set may define
assignmentssetName
- name of the setdesc
- description of the setprob
- probability of the setpublic Set()
Method Detail |
---|
public ParameterAssignmentSet getParameterAssignments(ParameterInstance paramInstance)
ParameterAssignment
objects for given
ParameterInstance
.
paramInstance
- the parameter instance
public final void addParameterInstance(ParameterInstance parameterInstance)
ParameterAssignment
objects to setData
. This is a
management method for the associated SetType
.
parameterInstance
- the parameter instance to be addedpublic ParameterAssignmentSet removeParameterInstance(ParameterInstance parameterInstance)
ParameterAssignment
objects will be removed from
setData
. This is a management method for the associated
SetType
.
parameterInstance
- the parameter instance to be removed
public void addParameterAssignment(ParameterAssignment paramAssign)
paramAssign
- parameter assignment to be addedpublic void removeParameterAssignment(ParameterAssignment paramAssign)
paramAssign
- parameter assignment to be removedprotected void setProblemOccurred(ParameterAssignment assignment)
RuntimeException
reporting on problems while processing a
ParameterAssignment
. This method is called when the
ParameterInstance
associated with the ParameterAssignment
is not managed by the SetType
of this set.
assignment
- the parameter assignment to be processedpublic int getNumberOfAssignments(ParameterInstance instance)
ParameterAssignment
objects for a
given ParameterInstance
.
instance
- the parameter instance
public boolean isValid()
public void setProbability(double probability)
IStochasticOccurrence
setProbability
in interface IStochasticOccurrence
probability
- the probability (in [0,1])public String toString()
toString
in class Object
public Map<ParameterInstance,ParameterAssignmentSet> getSetData()
public void setSetData(Map<ParameterInstance,ParameterAssignmentSet> setData)
public String getDescription()
public void setDescription(String description)
public String getName()
public void setName(String name)
public double getProbability()
IStochasticOccurrence
getProbability
in interface IStochasticOccurrence
public int getID()
public void setID(int uniqueID)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |