Package de.timefinder.data

Examples of de.timefinder.data.Location


                logger.severe("No event found for activity:" + activity.getName());
                continue;
            }

            event.setStart(ass.getSlot());
            Location tfLoc = locToRoom.getSecond(ass.getResource(0));
            if (tfLoc != null) {
                event.setLocation(tfLoc);
            } else
                logger.warning("No TF-room found for activity:" + activity.getName());
        }
View Full Code Here


        BufferedWriter writer = new BufferedWriter(new FileWriter(fileName + ".sln"));
        logger.debug("Write to file: " + fileName + ".sln");

        try {
            for (Event ti : optTIs) {
                Location r = ti.getLocation();
                assert ti.getStart() == -1 ? r == null : true;

                // Hint: If a Event was not assigned to the timetable the
                // starttime is null and the room is null, so this is fine:
                // writer.write("-1 -1");
View Full Code Here

            int noOfFeatures = Integer.parseInt(numberOf[2]);
            int noOfPersons = Integer.parseInt(numberOf[3]);

            // 2. Every line contains the capacity of one room
            for (int i = 0; i < noOfLocations; i++) {
                Location location = createLocation(Integer.parseInt(bReader.readLine()));
                location.putConstraint(newRasterConstraint());
//                EventSetConstraint esc = (EventSetConstraint) appCtx.getBean(ES_CONSTRAINT);
//                location.putConstraint(esc);
            }

            // initialize events
View Full Code Here

        }
        return -1;
    }

    public Location createLocation(int capacity) {
        Location loc = new Location();
        loc.setCapacity(capacity);
        getLocationDao().attach(loc);
        loc.setName("Room " + loc.getId());

        return loc;
    }
View Full Code Here

            }
            matrixList.add(oldMatrix);
        } else {
            int slot = startTimeNew;
            int end = startTimeNew + ass.getEvent().getDuration();
            Location loc = clusterArray.get(slot).calculateLocation(ass);
            if (loc == null) {
                ass.setStart(old);
                return null;
            }
View Full Code Here

    public final Object assign(Assignment ass) {
        if (!checkPreconditionsPass(ass))
            return null;

        Object rollbackData = createRollbackAssignData();
        Location loc = getPossibleLocation(ass);
        float[] column = createColumn(ass);
        if (loc != null)
            assign(ass, loc, column);
        else {
            //TODO PERFORMANCE: introduce possibility of skipping recalculation which
View Full Code Here

    public Location calculateLocation(Assignment assignment) {
        if (!checkPreconditionsPass(assignment))
            return null;

        // check against start + end
        Location loc = getPossibleLocation(assignment);
        if (loc != null)
            return loc;

        float newEntries[] = createColumn(assignment);
        int assignmentEntries[][] = calculateAssignment(newEntries);
View Full Code Here

            for (int assIndex = 0; assIndex < noOfEvents; assIndex++) {
                assert assignment[assIndex] != null :
                        "If you use PathGrowingAlgo check if the correct toBipartiteArray "
                        + "method was called with event:\n" + ass;
                Location loc = allLocations.get(assignment[assIndex][0]);
                removeFromAvailableLocations(allAssignments.get(assIndex), loc);
            }
            Location loc2 = allLocations.get(assignment[noOfEvents][0]);
            assign(ass, loc2, newEntries);
            return true;
        }

        return false;
View Full Code Here

        assertEquals(1, aManager.getAll().size());

        Feature loc1Feature = newFeature("special");
        loc1.addFeature(loc1Feature);

        Location locForEvent1 = newLocation("loc2", 5);
        allLocations.add(locForEvent1);
        aManager = new AssignmentManager(0, allLocations);
        aManager.setAlgorithm(new HungarianAlgorithm());
        Assignment event2 = newAssignment(0, 1);
        event2.getEvent().addFeature(loc1Feature);
View Full Code Here

        assertEquals(loc1, aManager.calculateLocation(event1));
    }

    @Test
    public void testAssignToLocation() {
        Location loc2 = newLocation("loc2", 5);
        allLocations.add(loc2);
        aManager = new AssignmentManager(0, allLocations);

        Assignment event1 = newAssignment(0, 1);
        assertNotNull(aManager.forceAssignment(event1, loc1));
View Full Code Here

TOP

Related Classes of de.timefinder.data.Location

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.