    001package org.cpsolver.ifs.assignment.context;
    002
    003import org.cpsolver.ifs.assignment.Assignment;
    004import org.cpsolver.ifs.criteria.AbstractCriterion;
    005import org.cpsolver.ifs.model.Model;
    006
    007/**
    008 * An interface marking an assignment context. The idea is that each
    009 * class that needs to keep some assignment dependent data will implements
    010 * {@link HasAssignmentContext} interface and the data will be wrapped by this class.
    011 * The {@link HasAssignmentContext} will only contain a reference to this
    012 * assignment context, created by calling {@link Model#createReference(HasAssignmentContext)}
    013 * during its initialization. The assignment context can be than accessed by calling
    014 * {@link Assignment#getAssignmentContext(AssignmentContextReference)}.<br><br>
    015 *
    016 * These assignment contexts are being held in memory by a class implementing the
    017 * {@link AssignmentContextHolder} interface. For constraints, criteria, extensions, and
    018 * neighborhood selections an existing class implementing the context can be used, see
    019 * {@link ConstraintWithContext}, {@link AbstractCriterion}, {@link ExtensionWithContext},
    020 * and {@link NeighbourSelectionWithContext} respectively.<br><br>
    021 *
    022 * For instance, when implementing {@link ConstraintWithContext}, only the method
    023 * {@link ConstraintWithContext#createAssignmentContext(Assignment)} needs to be implemented and the
    024 * assignment context can be accessed within the constraint using the method
    025 * {@link ConstraintWithContext#getContext(Assignment)}.
    026 *
    027 * @see AssignmentContextHolder
    028 * @see HasAssignmentContext
    029 *
    030 * @version IFS 1.3 (Iterative Forward Search)<br>
    031 *          Copyright (C) 2014 Tomáš Müller<br>
    032 *          <a href="mailto:muller@unitime.org">muller@unitime.org</a><br>
    033 *          <a href="http://muller.unitime.org">http://muller.unitime.org</a><br>
    034 * <br>
    035 *          This library is free software; you can redistribute it and/or modify
    036 *          it under the terms of the GNU Lesser General Public License as
    037 *          published by the Free Software Foundation; either version 3 of the
    038 *          License, or (at your option) any later version. <br>
    039 * <br>
    040 *          This library is distributed in the hope that it will be useful, but
    041 *          WITHOUT ANY WARRANTY; without even the implied warranty of
    042 *          MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    043 *          Lesser General Public License for more details. <br>
    044 * <br>
    045 *          You should have received a copy of the GNU Lesser General Public
    046 *          License along with this library; if not see <a href='http://www.gnu.org/licenses'>http://www.gnu.org/licenses</a>.
    047 **/
    048public interface AssignmentContext {
    049
    050}