001package net.sf.cpsolver.coursett.constraint; 002 003import java.util.Set; 004 005import net.sf.cpsolver.coursett.criteria.StudentConflict; 006import net.sf.cpsolver.coursett.model.Lecture; 007import net.sf.cpsolver.coursett.model.Placement; 008import net.sf.cpsolver.ifs.model.Constraint; 009 010/** 011 * Ignore student conflicts constraint. <br> 012 * This constraint keeps track of classes between which student conflicts of any kind are to be ignored. 013 * This constraint is used by {@link Lecture#isToIgnoreStudentConflictsWith(Lecture)} and translates to 014 * {@link StudentConflict#ignore(Lecture, Lecture)} that is true when the two classes are connected by 015 * this constraint. 016 * 017 * <br> 018 * 019 * @version CourseTT 1.2 (University Course Timetabling)<br> 020 * Copyright (C) 2013 Tomáš Müller<br> 021 * <a href="mailto:muller@unitime.org">muller@unitime.org</a><br> 022 * <a href="http://muller.unitime.org">http://muller.unitime.org</a><br> 023 * <br> 024 * This library is free software; you can redistribute it and/or modify 025 * it under the terms of the GNU Lesser General Public License as 026 * published by the Free Software Foundation; either version 3 of the 027 * License, or (at your option) any later version. <br> 028 * <br> 029 * This library is distributed in the hope that it will be useful, but 030 * WITHOUT ANY WARRANTY; without even the implied warranty of 031 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 032 * Lesser General Public License for more details. <br> 033 * <br> 034 * You should have received a copy of the GNU Lesser General Public 035 * License along with this library; if not see 036 * <a href='http://www.gnu.org/licenses/'>http://www.gnu.org/licenses/</a>. 037 */ 038public class IgnoreStudentConflictsConstraint extends Constraint<Lecture, Placement> { 039 040 public static final String REFERENCE = "NO_CONFLICT"; 041 042 @Override 043 public void addVariable(Lecture variable) { 044 super.addVariable(variable); 045 variable.clearIgnoreStudentConflictsWithCache(); 046 } 047 048 @Override 049 public void computeConflicts(Placement value, Set<Placement> conflicts) { 050 } 051 052 @Override 053 public boolean isHard() { 054 return false; 055 } 056 057}