Skip to content

Commit

Permalink
added -M-O-FD AI constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
konecny.mokum@gmail.com committed Sep 9, 2013
1 parent 26950e4 commit 60138a7
Showing 1 changed file with 24 additions and 2 deletions.
Expand Up @@ -119,7 +119,9 @@ public static enum Type {
MetByOrOverlappedBy(0L, APSPSolver.INF),

MetByOrOverlappedByOrAfter(0),


MetByOrOverlappedByOrIsFinishedByOrDuring(0L, APSPSolver.INF),

MeetsOrOverlapsOrBefore(0),

DuringOrEquals(0L, APSPSolver.INF, 0L, APSPSolver.INF),
Expand Down Expand Up @@ -191,7 +193,8 @@ public static AllenIntervalConstraint.Type fromString(String name) {
}
*/
}
};
};


//protected Type type;
private Bounds[] bounds;
Expand Down Expand Up @@ -817,6 +820,25 @@ else if(bounds[3].min == -APSPSolver.INF){
return ret;
}

if (types[0].equals(Type.MetByOrOverlappedByOrIsFinishedByOrDuring)) {
TimePoint fs = from.getStart();
TimePoint ts = to.getStart();
TimePoint fe = from.getEnd();
TimePoint te = to.getEnd();
SimpleDistanceConstraint first = new SimpleDistanceConstraint();
SimpleDistanceConstraint second = new SimpleDistanceConstraint();
first.setMinimum(1);
first.setMaximum(APSPSolver.INF);
first.setFrom(ts);
first.setTo(fs);
second.setMinimum(0);
second.setMaximum(APSPSolver.INF);
second.setFrom(fs);
second.setTo(te);
Constraint[] ret = {first,second};
return ret;
}

if (types[0].equals(Type.MeetsOrOverlapsOrBefore)) {
TimePoint ts = from.getStart();
TimePoint fs = to.getStart();
Expand Down

0 comments on commit 60138a7

Please sign in to comment.