p3j.simulation.assignments.exhaustive
Class SetTypeManager

java.lang.Object
  extended by p3j.simulation.assignments.exhaustive.SetTypeManager

public class SetTypeManager
extends Object

Manages a SetType for the ExhaustiveAssignmentGenerator. Relies on a SetManager for each Set defined for its SetType. Created: August 22, 2008

Author:
Christina Bohk, Roland Ewald

Constructor Summary
SetTypeManager(SetType setType)
          Default constructor.
 
Method Summary
protected  boolean createAssignments(int desiredSize)
          Creates most probable assignments up to the given desired size of the history.
 Map<ParameterInstance,ParameterAssignment> getAssignment(int assignmentIndex)
          Gets i-th most probable assignment.
 double getProbability(int assignmentIndex)
          Gets i-th most probable assignment probability.
 boolean hasAssignment(int assignmentIndex)
          Checks whether there are (at least) as many assignments as specified by the given index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SetTypeManager

public SetTypeManager(SetType setType)
Default constructor.

Parameters:
setType - the Settype to be managed
Method Detail

getProbability

public double getProbability(int assignmentIndex)
Gets i-th most probable assignment probability.

Parameters:
assignmentIndex - the desired index
Returns:
the probability of the i-th most probable assignment, -1 if there is no i-th assignment

getAssignment

public Map<ParameterInstance,ParameterAssignment> getAssignment(int assignmentIndex)
Gets i-th most probable assignment.

Parameters:
assignmentIndex - the desired index
Returns:
the i-th most probable assignment, null if nothing could be found(i.e., there are no more possible assignments)

hasAssignment

public boolean hasAssignment(int assignmentIndex)
Checks whether there are (at least) as many assignments as specified by the given index.

Parameters:
assignmentIndex - the desired assignment index
Returns:
true, if assignment with given index exists

createAssignments

protected final boolean createAssignments(int desiredSize)
Creates most probable assignments up to the given desired size of the history. TODO: When history is truncated every once in a while, this method needs to be adapted. It now assumes that the history is growing constantly.

Parameters:
desiredSize - the desired size of the history
Returns:
true, if new assignments could be created, otherwise false


Copyright © 2012. All Rights Reserved.