    001package net.sf.cpsolver.coursett.criteria.placement;
    002
    003import java.util.Set;
    004
    005import net.sf.cpsolver.coursett.model.Placement;
    006
    007/**
    008 * Use conflict-based statistics to compute potential hard conflicts.
    009 * <br>
    010 *
    011 * @version CourseTT 1.2 (University Course Timetabling)<br>
    012 *          Copyright (C) 2006 - 2011 Tomáš Müller<br>
    013 *          <a href="mailto:muller@unitime.org">muller@unitime.org</a><br>
    014 *          <a href="http://muller.unitime.org">http://muller.unitime.org</a><br>
    015 * <br>
    016 *          This library is free software; you can redistribute it and/or modify
    017 *          it under the terms of the GNU Lesser General Public License as
    018 *          published by the Free Software Foundation; either version 3 of the
    019 *          License, or (at your option) any later version. <br>
    020 * <br>
    021 *          This library is distributed in the hope that it will be useful, but
    022 *          WITHOUT ANY WARRANTY; without even the implied warranty of
    023 *          MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    024 *          Lesser General Public License for more details. <br>
    025 * <br>
    026 *          You should have received a copy of the GNU Lesser General Public
    027 *          License along with this library; if not see
    028 *          <a href='http://www.gnu.org/licenses/'>http://www.gnu.org/licenses/</a>.
    029 */
    030public class PotentialHardConflicts extends WeightedHardConflicts {
    031
    032    @Override
    033    public String getPlacementSelectionWeightName() {
    034        return "Placement.NrPotentialConflictsWeight";
    035    }
    036
    037    @Override
    038    public double getValue(Placement value, Set<Placement> conflicts) {
    039        return (iStat == null ? 0.0 : iStat.countPotentialConflicts(iIteration, value, 3));
    040    }
    041
    042    @Override
    043    public double getPlacementSelectionWeightDefault(int level) {
    044        return 0.0;
    045    }
    046
    047}