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