示例#1
0
 public static List<PeriodicTemporalConstraint> getPeriodicConstraints(
     EPlanElement element, boolean mustExist) {
   ConstraintsMember constraintsMember = element.getMember(ConstraintsMember.class, mustExist);
   if (constraintsMember == null) {
     return Collections.emptyList();
   }
   return constraintsMember.getPeriodicTemporalConstraints();
 }
 private Set<PeriodicTemporalConstraint> getRelevantConstraints(ConstraintsMember facet) {
   Set<PeriodicTemporalConstraint> result = new LinkedHashSet<PeriodicTemporalConstraint>();
   for (PeriodicTemporalConstraint constraint : facet.getPeriodicTemporalConstraints()) {
     if (isRelevantConstraint(constraint)) {
       result.add(constraint);
     }
   }
   return result;
 }
示例#3
0
 public static List<PeriodicTemporalConstraint> getPeriodicConstraints(
     EPlanElement element, Timepoint timepoint, boolean mustExist) {
   ConstraintsMember constraintsMember = element.getMember(ConstraintsMember.class, mustExist);
   if (constraintsMember == null) {
     return Collections.emptyList();
   }
   List<PeriodicTemporalConstraint> result = new ArrayList<PeriodicTemporalConstraint>();
   for (PeriodicTemporalConstraint constraint :
       constraintsMember.getPeriodicTemporalConstraints()) {
     ConstraintPoint point = constraint.getPoint();
     if ((point.getElement() == element) && (point.getEndpoint() == timepoint)) {
       result.add(constraint);
     }
   }
   return result;
 }
示例#4
0
 public static void detachConstraint(final PeriodicTemporalConstraint constraint) {
   ConstraintsMember member =
       constraint.getPoint().getElement().getMember(ConstraintsMember.class, true);
   member.getPeriodicTemporalConstraints().remove(constraint);
 }