001package org.cpsolver.ifs.assignment;
002
003import java.util.ArrayList;
004import java.util.Collection;
005
006import org.cpsolver.ifs.assignment.context.AssignmentContextHolderMap;
007import org.cpsolver.ifs.model.Value;
008import org.cpsolver.ifs.model.Variable;
009
010
011/**
012 * An empty assignment. All variables are unassigned, any attempt to assign a 
013 * variable will throw the {@link UnsupportedOperationException} exception.<br><br>  
014 * 
015 * @version IFS 1.3 (Iterative Forward Search)<br>
016 *          Copyright (C) 2014 Tomáš Müller<br>
017 *          <a href="mailto:muller@unitime.org">muller@unitime.org</a><br>
018 *          <a href="http://muller.unitime.org">http://muller.unitime.org</a><br>
019 * <br>
020 *          This library is free software; you can redistribute it and/or modify
021 *          it under the terms of the GNU Lesser General Public License as
022 *          published by the Free Software Foundation; either version 3 of the
023 *          License, or (at your option) any later version. <br>
024 * <br>
025 *          This library is distributed in the hope that it will be useful, but
026 *          WITHOUT ANY WARRANTY; without even the implied warranty of
027 *          MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
028 *          Lesser General Public License for more details. <br>
029 * <br>
030 *          You should have received a copy of the GNU Lesser General Public
031 *          License along with this library; if not see <a href='http://www.gnu.org/licenses'>http://www.gnu.org/licenses</a>.
032 * @param <V> Variable
033 * @param <T> Value
034 **/
035public class EmptyAssignment<V extends Variable<V, T>, T extends Value<V, T>> extends AssignmentAbstract<V, T> {
036
037    public EmptyAssignment() {
038        super(new AssignmentContextHolderMap<V,T>());
039    }
040
041    @Override
042    public long getIteration(V variable) {
043        return 0;
044    }
045
046    @Override
047    public Collection<V> assignedVariables() {
048        return new ArrayList<V>();
049    }
050
051    @Override
052    protected T getValueInternal(V variable) {
053        return null;
054    }
055
056    @Override
057    protected void setValueInternal(long iteration, V variable, T value) {
058        throw new UnsupportedOperationException();
059    }
060}