public class APSPSolver extends ConstraintSolver
ConstraintSolver.OPTIONS| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MAX_TPS |
static long |
INF
Public access class variable denoting the value infinity.
|
autoprop, components, constraintTypes, IDs, logger, name, nesting, noPropOnVarCreation, numcalls, skipPropagation, spacing, theNetwork, variableType| Constructor and Description |
|---|
APSPSolver(long origin,
long horizon)
Create a new APSPSolver with given temporal horizon.
|
APSPSolver(long origin,
long horizon,
int maxTPs)
Create a new APSPSolver with given temporal horizon and given maximum number of timepoints.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
addConstraintsSub(Constraint[] con)
This method must be implemented by the developer of the specific
ConstraintSolver
class. |
int |
bookmark() |
boolean |
changeHorizon(long val)
Set a new horizon for this network.
|
protected Variable[] |
createVariablesSub(int num)
This method must be implemented by the developer of the specific
ConstraintSolver
class. |
void |
draw()
Draw a graph representing this
APSPSolver's ConstraintNetwork. |
SimpleDistanceConstraint |
getConstraint(TimePoint tpFrom,
TimePoint tpTo)
Get active constraint between two
TimePoints. |
Bounds |
getDistanceBounds(TimePoint tpFrom,
TimePoint tpTo)
Gets the effective bounds between a pair of
TimePoints. |
TimePoint |
getEqualTimePoint(TimePoint queryTp) |
long |
getH()
Get the horizon of this
APSPSolver. |
int |
getMaxTps() |
long |
getO()
Get the time origin of this
APSPSolver. |
double |
getRMSRigidity()
This method computes the root mean square rigidity of a consistent STN (the inverse concept of flexibility of a STN).
|
TimePoint |
getSink()
Get the sink timepoint of the Simple Temporal Network (anchored to horizon).
|
TimePoint |
getSource()
Get the source timepoint of the Simple Temporal Network (anchored to origin of time).
|
TimePoint |
getTimePoint(int Id)
Get a timepoint given its ID.
|
int |
numBookmarks() |
java.lang.String |
printDist() |
java.lang.String |
printDistHist() |
static java.lang.String |
printLong(long l)
Class method for pretty-printing longs (substitutes +/-INF appropriately).
|
boolean |
propagate()
Perform complete propagation.
|
void |
registerValueChoiceFunctions() |
void |
removeBookmark(int i) |
protected void |
removeConstraintsSub(Constraint[] con)
This method must be implemented by the developer of the specific
ConstraintSolver
class. |
protected void |
removeVariablesSub(Variable[] ti)
This method must be implemented by the developer of the specific
ConstraintSolver
class. |
void |
revert(int i) |
void |
setAddingIndependentConstraints() |
java.lang.String |
toString()
Generates a String representation of the Simple Temporal Network (STN).
|
addConstraint, addConstraintNoPropagation, addConstraints, addConstraintsDebug, addConstraintsNoPropagation, containsVariable, createVariable, createVariable, createVariables, createVariables, createVariablesSub, deplenish, getComponent, getComponents, getConstraintNetwork, getConstraints, getConstraints, getDescription, getID, getOption, getVariable, getVariables, getVariables, getVariables, isCompatible, maskConstraints, removeConstraint, removeConstraints, removeVariable, removeVariables, setComponent, setComponents, setConstraintNetwork, setName, setOptions, unmaskConstraintspublic static final long INF
public static final int DEFAULT_MAX_TPS
public APSPSolver(long origin,
long horizon)
origin - The start time of the horizon.horizon - The end time of the horizon.public APSPSolver(long origin,
long horizon,
int maxTPs)
origin - The start time of the horizon.horizon - The end time of the horizon.maxTPs - maximum number of timepoints in the network
(excluding the Origin (O) and Horizon (H) timepoint)
(propagation is O((maxTPs+2)^3)).public TimePoint getTimePoint(int Id)
Id - The ID of the timepoint.public java.lang.String toString()
toString in class ConstraintSolverprotected Variable[] createVariablesSub(int num)
ConstraintSolverConstraintSolver
class. It should implement all operations necessary to create a batch of variable for the specific
type of ConstraintSolver.createVariablesSub in class ConstraintSolvernum - The number of variables to create.Variable for this ConstraintSolver.protected void removeVariablesSub(Variable[] ti)
ConstraintSolverConstraintSolver
class. It should implement all operations necessary to remove a batch of variables for
the specific type of ConstraintSolver.removeVariablesSub in class ConstraintSolverti - The Variables to remove.public void setAddingIndependentConstraints()
protected boolean addConstraintsSub(Constraint[] con)
ConstraintSolverConstraintSolver
class. It should implement all operations necessary to add multiple constraints, and should return
true upon success, false otherwise.addConstraintsSub in class ConstraintSolvercon - The constraints to add.true iff the constraints were added to the ConstraintNetwork.protected void removeConstraintsSub(Constraint[] con)
ConstraintSolverConstraintSolver
class. Should implement all operations necessary to remove a batch of constraints.removeConstraintsSub in class ConstraintSolvercon - The constraints to remove.public boolean propagate()
propagate in class ConstraintSolverTrue if propagation was successful, False otherwise.public long getO()
APSPSolver.APSPSolver.public long getH()
APSPSolver.APSPSolver.public boolean changeHorizon(long val)
val - The new horizon.True If the operation succeeded, False otherwise.public TimePoint getSource()
public TimePoint getSink()
public static java.lang.String printLong(long l)
l - The long value to pretty-print.public SimpleDistanceConstraint getConstraint(TimePoint tpFrom, TimePoint tpTo)
TimePoints.tpFrom - The source TimePoint.tpTo - The destination TimePoint.SimpleDistanceConstraint between the
two TimePoints (null if none exists).public Bounds getDistanceBounds(TimePoint tpFrom, TimePoint tpTo)
TimePoints.
(After propagation, considering all constraints in the network)public int getMaxTps()
APSPSolver(long, long, int)public void draw()
APSPSolver's ConstraintNetwork. This method depends on the Prefuse library.public double getRMSRigidity()
public int bookmark()
public void removeBookmark(int i)
public void revert(int i)
public int numBookmarks()
public java.lang.String printDist()
public java.lang.String printDistHist()
public void registerValueChoiceFunctions()
registerValueChoiceFunctions in class ConstraintSolver