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

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


            }
            return Integer.parseInt(line.substring(header.length() + 2, line.length() - 1));
        }

        private void readInstitutionalWeighting(Examination examination) throws IOException {
            InstitutionalWeighting institutionalWeighting = new InstitutionalWeighting();
            institutionalWeighting.setId(0L);
            String[] lineTokens;
            lineTokens = readInstitutionalWeightingProperty("TWOINAROW", 2);
            institutionalWeighting.setTwoInARowPenalty(Integer.parseInt(lineTokens[1]));
            lineTokens = readInstitutionalWeightingProperty("TWOINADAY", 2);
            institutionalWeighting.setTwoInADayPenalty(Integer.parseInt(lineTokens[1]));
            lineTokens = readInstitutionalWeightingProperty("PERIODSPREAD", 2);
            institutionalWeighting.setPeriodSpreadLength(Integer.parseInt(lineTokens[1]));
            institutionalWeighting.setPeriodSpreadPenalty(1); // constant
            lineTokens = readInstitutionalWeightingProperty("NONMIXEDDURATIONS", 2);
            institutionalWeighting.setMixedDurationPenalty(Integer.parseInt(lineTokens[1]));
            lineTokens = readInstitutionalWeightingProperty("FRONTLOAD", 4);
            institutionalWeighting.setFrontLoadLargeTopicSize(Integer.parseInt(lineTokens[1]));
            institutionalWeighting.setFrontLoadLastPeriodSize(Integer.parseInt(lineTokens[2]));
            institutionalWeighting.setFrontLoadPenalty(Integer.parseInt(lineTokens[3]));
            examination.setInstitutionalWeighting(institutionalWeighting);
        }
View Full Code Here


            }
            return Integer.parseInt(line.substring(header.length() + 2, line.length() - 1));
        }

        private void readInstitutionalWeighting(Examination examination) throws IOException {
            InstitutionalWeighting institutionalWeighting = new InstitutionalWeighting();
            institutionalWeighting.setId(0L);
            String[] lineTokens;
            lineTokens = readInstitutionalWeightingProperty("TWOINAROW", 2);
            institutionalWeighting.setTwoInARowPenality(Integer.parseInt(lineTokens[1]));
            lineTokens = readInstitutionalWeightingProperty("TWOINADAY", 2);
            institutionalWeighting.setTwoInADayPenality(Integer.parseInt(lineTokens[1]));
            lineTokens = readInstitutionalWeightingProperty("PERIODSPREAD", 2);
            institutionalWeighting.setPeriodSpreadLength(Integer.parseInt(lineTokens[1]));
            institutionalWeighting.setPeriodSpreadPenality(1); // constant
            lineTokens = readInstitutionalWeightingProperty("NONMIXEDDURATIONS", 2);
            institutionalWeighting.setMixedDurationPenality(Integer.parseInt(lineTokens[1]));
            lineTokens = readInstitutionalWeightingProperty("FRONTLOAD", 4);
            institutionalWeighting.setFrontLoadLargeTopicSize(Integer.parseInt(lineTokens[1]));
            institutionalWeighting.setFrontLoadLastPeriodSize(Integer.parseInt(lineTokens[2]));
            institutionalWeighting.setFrontLoadPenality(Integer.parseInt(lineTokens[3]));
            examination.setInstitutionalWeighting(institutionalWeighting);
        }
View Full Code Here

TOP

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

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.