001package org.cpsolver.coursett.criteria.additional; 002 003import java.util.Collection; 004import java.util.Map; 005 006import org.cpsolver.coursett.model.Lecture; 007import org.cpsolver.coursett.model.Placement; 008import org.cpsolver.ifs.assignment.Assignment; 009import org.cpsolver.ifs.util.DataProperties; 010 011 012/** 013 * Important student hard conflicts. Same as {@link ImportantStudentConflict}, but 014 * only hard student conflicts are counted (between classes that do not have alternatives, 015 * see {@link Lecture#isSingleSection()}). Weighted by Comparator.ImportantHardStudentConflictWeight 016 * parameter. 017 * . 018 * <br> 019 * 020 * @version CourseTT 1.3 (University Course Timetabling)<br> 021 * Copyright (C) 2006 - 2014 Tomas Muller<br> 022 * <a href="mailto:muller@unitime.org">muller@unitime.org</a><br> 023 * <a href="http://muller.unitime.org">http://muller.unitime.org</a><br> 024 * <br> 025 * This library is free software; you can redistribute it and/or modify 026 * it under the terms of the GNU Lesser General Public License as 027 * published by the Free Software Foundation; either version 3 of the 028 * License, or (at your option) any later version. <br> 029 * <br> 030 * This library is distributed in the hope that it will be useful, but 031 * WITHOUT ANY WARRANTY; without even the implied warranty of 032 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 033 * Lesser General Public License for more details. <br> 034 * <br> 035 * You should have received a copy of the GNU Lesser General Public 036 * License along with this library; if not see 037 * <a href='http://www.gnu.org/licenses/'>http://www.gnu.org/licenses/</a>. 038 */ 039public class ImportantStudentHardConflict extends ImportantStudentConflict { 040 041 @Override 042 public boolean isApplicable(Lecture l1, Lecture l2) { 043 return l1 != null && l2 != null && !ignore(l1, l2) && hard(l1, l2) && important(l1, l2); 044 } 045 046 @Override 047 public double getWeightDefault(DataProperties config) { 048 return config.getPropertyDouble("Comparator.ImportantHardStudentConflictWeight", 049 3.0 * config.getPropertyDouble("Comparator.HardStudentConflictWeight", 5.0)); 050 } 051 052 @Override 053 public String getPlacementSelectionWeightName() { 054 return "Placement.NrImportantHardStudConfsWeight"; 055 } 056 057 @Override 058 public void getInfo(Assignment<Lecture, Placement> assignment, Map<String, String> info) { 059 } 060 061 @Override 062 public void getInfo(Assignment<Lecture, Placement> assignment, Map<String, String> info, Collection<Lecture> variables) { 063 } 064}