jopt.js.spi.constraint
Class TemporalConstraint

java.lang.Object
  extended byjopt.csp.spi.arcalgorithm.variable.VariableChangeBase
      extended byjopt.csp.spi.arcalgorithm.constraint.AbstractConstraint
          extended byjopt.js.spi.constraint.TemporalConstraint
All Implemented Interfaces:
jopt.csp.variable.CspConstraint, jopt.csp.spi.arcalgorithm.graph.GraphConstraint, jopt.csp.spi.util.NumConstants, jopt.csp.spi.arcalgorithm.graph.arc.PostableConstraint, SchedulerConstraint, jopt.csp.spi.solver.VariableChangeSource

public class TemporalConstraint
extends jopt.csp.spi.arcalgorithm.constraint.AbstractConstraint
implements jopt.csp.spi.solver.VariableChangeSource, SchedulerConstraint

A constraint to maintain temporal relations between activities.

Author:
jboerkoel

Field Summary
 
Fields inherited from interface jopt.csp.spi.util.NumConstants
ADD, DIVIDE, DIVIDE_BY, DIVIDE_BY_CEIL, DIVIDE_BY_FLOOR, DIVIDE_CEIL, DIVIDE_FLOOR, DOUBLE, DOUBLE_NEG_INF, DOUBLE_POS_INF, DOUBLE_ZERO, EQ, FLOAT, FLOAT_NEG_INF, FLOAT_POS_INF, FLOAT_ZERO, GEQ, GT, HALF_PI, INTEGER, INTEGER_MAX, INTEGER_MIN, INTEGER_ZERO, LEQ, LONG, LONG_MAX, LONG_MIN, LONG_ZERO, LT, MULTIPLY, NEQ, ONE_AND_HALF_PI, PI, RANGE, SUBTRACT, SUBTRACT_FROM, TWO_PI
 
Constructor Summary
TemporalConstraint(ActivityExpr source, ActivityExpr target, int sourceEntity, int targetEntity, int relation)
          Constructs a temporal constraint
TemporalConstraint(ActivityExpr source, ActivityExpr target, int sourceEntity, int targetEntity, int relation, int delay)
          Constructs a temporal constraint
TemporalConstraint(ActivityExpr source, jopt.csp.spi.arcalgorithm.variable.IntExpr target, int sourceEntity, int targetEntity, int relation)
          Constructs a temporal constraint
TemporalConstraint(ActivityExpr source, jopt.csp.spi.arcalgorithm.variable.IntExpr target, int sourceEntity, int targetEntity, int relation, int delay)
          Constructs a temporal constraint
TemporalConstraint(jopt.csp.spi.arcalgorithm.variable.IntExpr source, ActivityExpr target, int sourceEntity, int targetEntity, int relation)
          Constructs a temporal constraint
TemporalConstraint(jopt.csp.spi.arcalgorithm.variable.IntExpr source, ActivityExpr target, int sourceEntity, int targetEntity, int relation, int delay)
          Constructs a temporal constraint
 
Method Summary
 void addVariableChangeListener(jopt.csp.spi.solver.VariableChangeListener listener)
          Adds a listener interested in variable change events
 jopt.csp.spi.arcalgorithm.graph.arc.Arc[] getBooleanSourceArcs()
           
 jopt.csp.spi.arcalgorithm.graph.node.Node[] getBooleanSourceNodes()
           
 jopt.js.api.variable.SchedulerExpression[] getExpressions()
          Returns any and all Scheduler Expressions that are involved with the problem
 void postToGraph()
          Posts the constraint to the graph
 
Methods inherited from class jopt.csp.spi.arcalgorithm.constraint.AbstractConstraint
associateToGraph, getGraphConstraintFragment, getPostableOpposite, isFalse, isTrue, isViolated, toBoolean
 
Methods inherited from class jopt.csp.spi.arcalgorithm.variable.VariableChangeBase
removeVariableChangeListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jopt.csp.spi.solver.VariableChangeSource
removeVariableChangeListener
 

Constructor Detail

TemporalConstraint

public TemporalConstraint(ActivityExpr source,
                          ActivityExpr target,
                          int sourceEntity,
                          int targetEntity,
                          int relation,
                          int delay)
Constructs a temporal constraint

Parameters:
source - Activity that acts the source
target - activity that acts as the target
sourceEntity - an int representing which of the entities (start, end, duration) of the source is being referenced
targetEntity - an int representing which of the entities (start, end, duration) of the target is being referenced
relation - an int representing a constant BEFORE, AFTER, AT
delay - the amount of delay that must occur between the two

TemporalConstraint

public TemporalConstraint(jopt.csp.spi.arcalgorithm.variable.IntExpr source,
                          ActivityExpr target,
                          int sourceEntity,
                          int targetEntity,
                          int relation,
                          int delay)
Constructs a temporal constraint

Parameters:
source - expr that acts the source
target - activity that acts as the target
sourceEntity - an int representing which of the entities (start, end, duration) of the source is being referenced
targetEntity - an int representing which of the entities (start, end, duration) of the target is being referenced
relation - an int representing a constant BEFORE, AFTER, AT
delay - the amount of delay that must occur between the two

TemporalConstraint

public TemporalConstraint(ActivityExpr source,
                          jopt.csp.spi.arcalgorithm.variable.IntExpr target,
                          int sourceEntity,
                          int targetEntity,
                          int relation,
                          int delay)
Constructs a temporal constraint

Parameters:
source - Activity that acts the source
target - expression that acts as the target
sourceEntity - an int representing which of the entities (start, end, duration) of the source is being referenced
targetEntity - an int representing which of the entities (start, end, duration) of the target is being referenced
relation - an int representing a constant BEFORE, AFTER, AT
delay - the amount of delay that must occur between the two

TemporalConstraint

public TemporalConstraint(ActivityExpr source,
                          ActivityExpr target,
                          int sourceEntity,
                          int targetEntity,
                          int relation)
Constructs a temporal constraint

Parameters:
source - Activity that acts the source
target - activity that acts as the target
sourceEntity - an int representing which of the entities (start, end, duration) of the source is being referenced
targetEntity - an int representing which of the entities (start, end, duration) of the target is being referenced
relation - an int representing a constant BEFORE, AFTER, AT

TemporalConstraint

public TemporalConstraint(jopt.csp.spi.arcalgorithm.variable.IntExpr source,
                          ActivityExpr target,
                          int sourceEntity,
                          int targetEntity,
                          int relation)
Constructs a temporal constraint

Parameters:
source - expression that acts the source
target - activity that acts as the target
sourceEntity - an int representing which of the entities (start, end, duration) of the source is being referenced
targetEntity - an int representing which of the entities (start, end, duration) of the target is being referenced
relation - an int representing a constant BEFORE, AFTER, AT

TemporalConstraint

public TemporalConstraint(ActivityExpr source,
                          jopt.csp.spi.arcalgorithm.variable.IntExpr target,
                          int sourceEntity,
                          int targetEntity,
                          int relation)
Constructs a temporal constraint

Parameters:
source - Activity that acts the source
target - expression that acts as the target
sourceEntity - an int representing which of the entities (start, end, duration) of the source is being referenced
targetEntity - an int representing which of the entities (start, end, duration) of the target is being referenced
relation - an int representing a constant BEFORE, AFTER, AT
Method Detail

getExpressions

public jopt.js.api.variable.SchedulerExpression[] getExpressions()
Description copied from interface: SchedulerConstraint
Returns any and all Scheduler Expressions that are involved with the problem

Specified by:
getExpressions in interface SchedulerConstraint
Returns:
all expressions involved with the problem

postToGraph

public void postToGraph()
Posts the constraint to the graph

Specified by:
postToGraph in interface jopt.csp.spi.arcalgorithm.graph.arc.PostableConstraint

addVariableChangeListener

public void addVariableChangeListener(jopt.csp.spi.solver.VariableChangeListener listener)
Adds a listener interested in variable change events

Specified by:
addVariableChangeListener in interface jopt.csp.spi.solver.VariableChangeSource

getBooleanSourceArcs

public jopt.csp.spi.arcalgorithm.graph.arc.Arc[] getBooleanSourceArcs()
Specified by:
getBooleanSourceArcs in interface jopt.csp.spi.arcalgorithm.graph.arc.PostableConstraint

getBooleanSourceNodes

public jopt.csp.spi.arcalgorithm.graph.node.Node[] getBooleanSourceNodes()
Specified by:
getBooleanSourceNodes in interface jopt.csp.spi.arcalgorithm.graph.arc.PostableConstraint