Package de.timefinder.algo.roomassignment

Examples of de.timefinder.algo.roomassignment.AssignmentManager


        invalidAssignments = new ArrayList<Assignment>();

        clusterArray = new ArrayList<AssignmentManager>(noOfSlots);
        //make sure that all groups exist
        for (int slot = 0; slot < noOfSlots; slot++) {
            clusterArray.add(new AssignmentManager(slot, allRooms));
        }
    }
View Full Code Here


     *                              every call of this method we remove nearly the same events
     *                              where percentage increases the length of this 'same Event'
     *                              - list.
     */
    private void randomHCPreparation(double percentageOfChanges, boolean shuffleBeforeRemoving) {
        AssignmentManager assMngr;
        for (int assMngrIndex = clusterArray.size() - 1; assMngrIndex >= 0; assMngrIndex--) {
            assMngr = clusterArray.get(assMngrIndex);
            int size = assMngr.getAll().size();
            if (size == 0)
                continue;

            // clone it for the for-loop!
            List<Assignment> coll = new ArrayList<Assignment>(assMngr.getAll());
            int TI_BORDER = (int) Math.round(size * percentageOfChanges);
            int index = random.nextInt(size);
            for (int counter = 0; counter < TI_BORDER; index++, counter++) {
                if (index >= size)
                    index = 0;
View Full Code Here

    Collection<Assignment> getAll(int startTime, int duration) {
        Set<Assignment> set = FastSet.newInstance();
        int maximalIndex = Math.min(startTime + duration, clusterArray.size());
        for (int eventGroupIndex = startTime; eventGroupIndex < maximalIndex; eventGroupIndex++) {
            AssignmentManager eventGroup = clusterArray.get(eventGroupIndex);
            set.addAll(eventGroup.getAll());
        }

        return set;
    }
View Full Code Here

TOP

Related Classes of de.timefinder.algo.roomassignment.AssignmentManager

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.