ix.iplan
Class TimePointNet

java.lang.Object
  extended by ix.iplan.TimePointNet
All Implemented Interfaces:
ConstraintManager

public class TimePointNet
extends java.lang.Object
implements ConstraintManager

Time-point Network.


Nested Class Summary
(package private) static class TimePointNet.Change
           
static class TimePointNet.TimeConstraint
          An internal representation of temporal "before" constraints.
 
Field Summary
(package private) static Symbol BEFORE
          Syntax word.
(package private) static Symbol DURATION
          Syntax word.
protected  ContextMap knownPoints
           
protected  ContextInt numberOfPoints
           
protected  TimePoint timePointAtZero
           
(package private) static Symbol WINDOW
          Syntax word.
 
Constructor Summary
TimePointNet()
          Constructs an empty time-point network.
 
Method Summary
 void addConstraint(Constraint c)
           
 void addConstraint(PNode node, Constraint c)
           
 void addOrdering(java.util.Map idToNodeMap, Ordering ord)
           
 boolean addTimeConstraint(TimePoint pre, TimePoint post, long min, long max)
           
 void addTimeConstraintElseFail(TimePoint pre, TimePoint post)
           
 TimePoint addTimePoint(long min, long max)
           
 TimePoint addTimePoint(TimePoint t)
           
 void clear()
           
(package private)  void constrainMax(TimePoint pre, TimePoint post, long len)
           
(package private)  void constrainMin(TimePoint pre, TimePoint post, long len)
           
protected  void deleteTimeConstraint(TimePointNet.TimeConstraint c)
          Removes the constraint from its pre- and post-points.
 void describeTPN(java.io.PrintStream out)
           
 void evalAtBegin(PNodeEnd ne, Constraint c)
           
 void evalAtEnd(PNodeEnd ne, Constraint c)
           
protected  void evalBeforeConstraint(PNode node, Constraint c)
           
protected  void evalConstraint(PNode node, Constraint c)
           
protected  void evalDurationConstraint(PNode node, Constraint c)
           
protected  void evalWindowAtConstraint(PNode node, Constraint c)
           
(package private)  boolean findMaxValues(java.util.List initialActivePoints)
           
(package private)  boolean findMinValues(java.util.List initialActivePoints)
           
protected  int getNumberOfPoints()
           
 void makeTimePointAtZero()
           
 boolean mightInteract(PNodeEnd ne1, Constraint c1, PNodeEnd ne2, Constraint c2)
           
protected  boolean propagateAfterAdding(TimePointNet.TimeConstraint c)
           
 void registerWith(ConstraintManagerRegistry r)
           
 void reset()
           
(package private)  void undoTpnChanges(java.util.List changeHistory)
           
protected  boolean updateTimeWindows(java.util.List initialPoints)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

knownPoints

protected ContextMap knownPoints

numberOfPoints

protected ContextInt numberOfPoints

timePointAtZero

protected TimePoint timePointAtZero

DURATION

static final Symbol DURATION
Syntax word.


BEFORE

static final Symbol BEFORE
Syntax word.


WINDOW

static final Symbol WINDOW
Syntax word.

Constructor Detail

TimePointNet

public TimePointNet()
Constructs an empty time-point network.

Method Detail

getNumberOfPoints

protected int getNumberOfPoints()

registerWith

public void registerWith(ConstraintManagerRegistry r)
Specified by:
registerWith in interface ConstraintManager

reset

public void reset()
Specified by:
reset in interface ConstraintManager

clear

public void clear()
Specified by:
clear in interface ConstraintManager

addConstraint

public void addConstraint(Constraint c)
Specified by:
addConstraint in interface ConstraintManager
Throws:
java.lang.UnsupportedOperationException - if called.

addOrdering

public void addOrdering(java.util.Map idToNodeMap,
                        Ordering ord)

addConstraint

public void addConstraint(PNode node,
                          Constraint c)
Specified by:
addConstraint in interface ConstraintManager

evalConstraint

protected void evalConstraint(PNode node,
                              Constraint c)

evalDurationConstraint

protected void evalDurationConstraint(PNode node,
                                      Constraint c)

evalBeforeConstraint

protected void evalBeforeConstraint(PNode node,
                                    Constraint c)

evalWindowAtConstraint

protected void evalWindowAtConstraint(PNode node,
                                      Constraint c)

evalAtBegin

public void evalAtBegin(PNodeEnd ne,
                        Constraint c)
Specified by:
evalAtBegin in interface ConstraintManager

evalAtEnd

public void evalAtEnd(PNodeEnd ne,
                      Constraint c)
Specified by:
evalAtEnd in interface ConstraintManager
Throws:
java.lang.UnsupportedOperationException - if called.

mightInteract

public boolean mightInteract(PNodeEnd ne1,
                             Constraint c1,
                             PNodeEnd ne2,
                             Constraint c2)
Specified by:
mightInteract in interface ConstraintManager
Throws:
java.lang.UnsupportedOperationException - if called.

addTimePoint

public TimePoint addTimePoint(long min,
                              long max)

addTimePoint

public TimePoint addTimePoint(TimePoint t)

makeTimePointAtZero

public void makeTimePointAtZero()

addTimeConstraintElseFail

public void addTimeConstraintElseFail(TimePoint pre,
                                      TimePoint post)

addTimeConstraint

public boolean addTimeConstraint(TimePoint pre,
                                 TimePoint post,
                                 long min,
                                 long max)

deleteTimeConstraint

protected void deleteTimeConstraint(TimePointNet.TimeConstraint c)
Removes the constraint from its pre- and post-points.


describeTPN

public void describeTPN(java.io.PrintStream out)

propagateAfterAdding

protected boolean propagateAfterAdding(TimePointNet.TimeConstraint c)

updateTimeWindows

protected boolean updateTimeWindows(java.util.List initialPoints)

findMinValues

boolean findMinValues(java.util.List initialActivePoints)

constrainMin

void constrainMin(TimePoint pre,
                  TimePoint post,
                  long len)

undoTpnChanges

void undoTpnChanges(java.util.List changeHistory)

findMaxValues

boolean findMaxValues(java.util.List initialActivePoints)

constrainMax

void constrainMax(TimePoint pre,
                  TimePoint post,
                  long len)