Package de.timefinder.algo.constraint

Examples of de.timefinder.algo.constraint.MinGapsConstraint


                        p.addEvent(ev, Role.STUDENT, true);
                    }
                }

                for (Person p : cInstance.getStudents()) {
                    MinGapsConstraint minGapConstr = new MinGapsConstraint(settings, p.getEvents());
                    minGapConstr.setWeight(1.0f);
                    p.putConstraint(minGapConstr);
                }

                // bind the constraint only if it makes sense
                if (eventsForDiffDay.size() > 1) {
View Full Code Here


                }
            } else if (constr instanceof PersonITCRasterConstraint) {
                PersonITCRasterConstraint pc = (PersonITCRasterConstraint) constr;
                el.addElement("person").addAttribute("ref", "" + pc.getPerson().getId());
            } else if (constr instanceof MinGapsConstraint) {
                MinGapsConstraint mgc = (MinGapsConstraint) constr;
                el.addAttribute("countEarly", "" + mgc.isCountEarly());
                for (Event ev : mgc.getEvents()) {
                    el.addElement("event").addAttribute("ref", "" + ev.getId());
                }
            } else if (constr instanceof DifferentDayConstraint) {
                DifferentDayConstraint ddc = (DifferentDayConstraint) constr;
                for (Event ev : ddc.getEvents()) {
View Full Code Here

            } else if (PersonITCRasterConstraint.class.getSimpleName().equals(element.getName())) {
                Person p = getObject(getRef(element.element("person")), Person.class);
                constraint = new PersonITCRasterConstraint(p, settings);

            } else if (MinGapsConstraint.class.getSimpleName().equals(element.getName())) {
                constraint = new MinGapsConstraint(settings,
                        readCollection(element, Event.class));
                ((MinGapsConstraint) constraint).setCountEarly(
                        Boolean.parseBoolean(element.attributeValue("countEarly")));

            } else if (DifferentDayConstraint.class.getSimpleName().equals(element.getName())) {
View Full Code Here

        ev1.putConstraint(rasterC1);
        DifferentDayConstraint ddc = new DifferentDayConstraint(settings, Arrays.asList(ev2));
        ev1.putConstraint(ddc);

        MinGapsConstraint mgc = new MinGapsConstraint(settings, Arrays.asList(ev3));
        mgc.setCountEarly(true);
        ev1.putConstraint(mgc);

        EventOrderConstraint orderC1 = new EventOrderConstraint(ev2);
        orderC1.addBefore(ev1);
        orderC1.addFollow(ev4);
View Full Code Here

        assertEquals(tmpLoc1, tmpEv1.getLocation());

        DifferentDayConstraint ddc = tmpEv1.getConstraint(DifferentDayConstraint.class);
        assertTrue(ddc.getEvents().contains(tmpEv2));

        MinGapsConstraint mgc = tmpEv1.getConstraint(MinGapsConstraint.class);
        assertTrue(mgc.getEvents().contains(tmpEv3));
        assertTrue(mgc.isCountEarly());

        oldAssertations(dataPool);
    }
View Full Code Here

TOP

Related Classes of de.timefinder.algo.constraint.MinGapsConstraint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.