Package org.drools.planner.examples.curriculumcourse.domain

Examples of org.drools.planner.examples.curriculumcourse.domain.Room


                roomPanelMap.put(room, periodRoomPanel);
            }
        }
        for (Lecture lecture : schedule.getLectureList()) {
            Period period = lecture.getPeriod();
            Room room = lecture.getRoom();
            if (period != null && room != null) {
                PeriodRoomPanel periodRoomPanel = periodRoomPanelMap.get(period).get(room);
                periodRoomPanel.addLecture(lecture);
            }
        }
View Full Code Here


            int result = JOptionPane.showConfirmDialog(CurriculumCoursePanel.this.getRootPane(), listFieldsPanel,
                    "Select period and room", JOptionPane.OK_CANCEL_OPTION);
            if (result == JOptionPane.OK_OPTION) {
                Period toPeriod = (Period) periodListField.getSelectedItem();
                solutionBusiness.doMove(new PeriodChangeMove(lecture, toPeriod));
                Room toRoom = (Room) roomListField.getSelectedItem();
                solutionBusiness.doMove(new RoomChangeMove(lecture, toRoom));
                solverAndPersistenceFrame.resetScreen();
            }
        }
View Full Code Here

                throws IOException {
            readEmptyLine();
            readConstantLine("ROOMS:");
            List<Room> roomList = new ArrayList<Room>(roomListSize);
            for (int i = 0; i < roomListSize; i++) {
                Room room = new Room();
                room.setId((long) i);
                // Rooms: <RoomID> <Capacity>
                String line = bufferedReader.readLine();
                String[] lineTokens = splitBySpacesOrTabs(line, 2);
                room.setCode(lineTokens[0]);
                room.setCapacity(Integer.parseInt(lineTokens[1]));
                roomList.add(room);
            }
            schedule.setRoomList(roomList);
        }
View Full Code Here

            Collections.sort(periodScoringList);

            boolean almostPerfectMatch = false;
            Score bestScore = DefaultHardAndSoftScore.valueOf(Integer.MIN_VALUE, Integer.MIN_VALUE);
            Period bestPeriod = null;
            Room bestRoom = null;
            for (PeriodScoring periodScoring : periodScoringList) {
                if (bestScore.compareTo(periodScoring.getScore()) >= 0) {
                    // No need to check the rest
                    break;
                }
View Full Code Here

            int result = JOptionPane.showConfirmDialog(CurriculumCoursePanel.this.getRootPane(), listFieldsPanel,
                    "Select period and room", JOptionPane.OK_CANCEL_OPTION);
            if (result == JOptionPane.OK_OPTION) {
                Period toPeriod = (Period) periodListField.getSelectedItem();
                solutionBusiness.doMove(new PeriodChangeMove(lecture, toPeriod));
                Room toRoom = (Room) roomListField.getSelectedItem();
                solutionBusiness.doMove(new RoomChangeMove(lecture, toRoom));
                workflowFrame.updateScreen();
            }
        }
View Full Code Here

    }

    public void doMove(WorkingMemory workingMemory) {
        Period oldLeftPeriod = leftLecture.getPeriod();
        Period oldRightPeriod = rightLecture.getPeriod();
        Room oldLeftRoom = leftLecture.getRoom();
        Room oldRightRoom = rightLecture.getRoom();
        if (oldLeftPeriod.equals(oldRightPeriod)) {
            CurriculumCourseMoveHelper.moveRoom(workingMemory, leftLecture, oldRightRoom);
            CurriculumCourseMoveHelper.moveRoom(workingMemory, rightLecture, oldLeftRoom);
        } else if (oldLeftRoom.equals(oldRightRoom)) {
            CurriculumCourseMoveHelper.movePeriod(workingMemory, leftLecture, oldRightPeriod);
View Full Code Here

        private void readRoomList(CurriculumCourseSchedule schedule, int roomListSize)
                throws IOException {
            readHeader("ROOMS:");
            List<Room> roomList = new ArrayList<Room>(roomListSize);
            for (int i = 0; i < roomListSize; i++) {
                Room room = new Room();
                room.setId((long) i);
                // Rooms: <RoomID> <Capacity>
                String line = bufferedReader.readLine();
                String[] lineTokens = line.split(SPLIT_REGEX);
                if (lineTokens.length != 2) {
                    throw new IllegalArgumentException("Read line (" + line + ") is expected to contain 2 tokens.");
                }
                room.setCode(lineTokens[0]);
                room.setCapacity(Integer.parseInt(lineTokens[1]));
                roomList.add(room);
            }
            schedule.setRoomList(roomList);
        }
View Full Code Here

                roomPanelMap.put(room, periodRoomPanel);
            }
        }
        for (Lecture lecture : schedule.getLectureList()) {
            Period period = lecture.getPeriod();
            Room room = lecture.getRoom();
            if (period != null && room != null) {
                PeriodRoomPanel periodRoomPanel = periodRoomPanelMap.get(period).get(room);
                periodRoomPanel.addLecture(lecture);
            }
        }
View Full Code Here

            int result = JOptionPane.showConfirmDialog(CurriculumCoursePanel.this.getRootPane(), listFieldsPanel,
                    "Select period and room", JOptionPane.OK_CANCEL_OPTION);
            if (result == JOptionPane.OK_OPTION) {
                Period toPeriod = (Period) periodListField.getSelectedItem();
                solutionBusiness.doMove(new PeriodChangeMove(lecture, toPeriod));
                Room toRoom = (Room) roomListField.getSelectedItem();
                solutionBusiness.doMove(new RoomChangeMove(lecture, toRoom));
                solverAndPersistenceFrame.resetScreen();
            }
        }
View Full Code Here

public class RoomStrengthWeightFactory implements PlanningValueStrengthWeightFactory {

    public Comparable createStrengthWeight(Solution solution, Object planningValue) {
        CurriculumCourseSchedule schedule = (CurriculumCourseSchedule) solution;
        Room room = (Room) planningValue;
        return new RoomStrengthWeight(room);
    }
View Full Code Here

TOP

Related Classes of org.drools.planner.examples.curriculumcourse.domain.Room

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.