Package org.drools.planner.examples.examination.domain

Examples of org.drools.planner.examples.examination.domain.PeriodPenalty


            List<PeriodPenalty> periodPenaltyList = new ArrayList<PeriodPenalty>();
            String line = bufferedReader.readLine();
            int id = 0;
            while (!line.equals("[RoomHardConstraints]")) {
                String[] lineTokens = line.split(SPLIT_REGEX);
                PeriodPenalty periodPenalty = new PeriodPenalty();
                periodPenalty.setId((long) id);
                if (lineTokens.length != 3) {
                    throw new IllegalArgumentException("Read line (" + line + ") is expected to contain 3 tokens.");
                }
                Topic leftTopic = topicList.get(Integer.parseInt(lineTokens[0]));
                periodPenalty.setLeftSideTopic(leftTopic);
                PeriodPenaltyType periodPenaltyType = PeriodPenaltyType.valueOf(lineTokens[1]);
                periodPenalty.setPeriodPenaltyType(periodPenaltyType);
                Topic rightTopic = topicList.get(Integer.parseInt(lineTokens[2]));
                periodPenalty.setRightSideTopic(rightTopic);
                if (periodPenaltyType == PeriodPenaltyType.EXAM_COINCIDENCE) {
                    // It's not specified what happens
                    // when A coincidences with B and B coincidences with C
                    // and when A and C share students (but don't directly coincidence)
                    if (!Collections.disjoint(leftTopic.getStudentList(), rightTopic.getStudentList())) {
View Full Code Here


            List<PeriodPenalty> periodPenaltyList = new ArrayList<PeriodPenalty>();
            String line = bufferedReader.readLine();
            int id = 0;
            while (!line.equals("[RoomHardConstraints]")) {
                String[] lineTokens = line.split(SPLIT_REGEX);
                PeriodPenalty periodPenalty = new PeriodPenalty();
                periodPenalty.setId((long) id);
                if (lineTokens.length != 3) {
                    throw new IllegalArgumentException("Read line (" + line + ") is expected to contain 3 tokens.");
                }
                Topic leftTopic = topicList.get(Integer.parseInt(lineTokens[0]));
                periodPenalty.setLeftSideTopic(leftTopic);
                PeriodPenaltyType periodPenaltyType = PeriodPenaltyType.valueOf(lineTokens[1]);
                periodPenalty.setPeriodPenaltyType(periodPenaltyType);
                Topic rightTopic = topicList.get(Integer.parseInt(lineTokens[2]));
                periodPenalty.setRightSideTopic(rightTopic);
                if (periodPenaltyType == PeriodPenaltyType.EXAM_COINCIDENCE) {
                    // It's not specified what happens
                    // when A coincidences with B and B coincidences with C
                    // and when A and C share students (but don't directly coincidence)
                    if (!Collections.disjoint(leftTopic.getStudentList(), rightTopic.getStudentList())) {
View Full Code Here

TOP

Related Classes of org.drools.planner.examples.examination.domain.PeriodPenalty

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.