choco.kernel.memory.copy
Class EnvironmentCopying

java.lang.Object
  extended by choco.kernel.memory.AbstractEnvironment
      extended by choco.kernel.memory.copy.EnvironmentCopying
All Implemented Interfaces:
IEnvironment

public class EnvironmentCopying
extends AbstractEnvironment


Field Summary
protected static Stack<Integer> clonedWorldIdxStack
           
static RecomputableElement[][] elements
           
static int[] indices
           
 int nbCopy
           
 
Fields inherited from class choco.kernel.memory.AbstractEnvironment
currentBitSet, currentWorld, nextOffset
 
Fields inherited from interface choco.kernel.memory.IEnvironment
LOGGER
 
Constructor Summary
EnvironmentCopying()
           
 
Method Summary
 void add(RecomputableElement rc)
           
 void clear()
          Clear the entire internal structures
 int getNbCopy()
           
 IStateBinaryTree makeBinaryTree(int inf, int sup)
           
 IStateBool makeBool(boolean initialValue)
          Factory pattern: new IStateBool objects are created by the environment
 IStateDoubleVector makeDoubleVector()
          Factory pattern: new IStateDoubleVector objects are created by the environment.
 IStateDoubleVector makeDoubleVector(double[] entries)
          Factory pattern: new IStateDoubleVector objects are created by the environment
 IStateDoubleVector makeDoubleVector(int size, double initialValue)
          Factory pattern: new IStateDoubleVector objects are created by the environment
 IStateDouble makeFloat()
          Factory pattern: new StoredFloat objects are created by the environment (no initial value is assigned to the backtrackable search)
 IStateDouble makeFloat(double initialValue)
          Factory pattern: new StoredFloat objects are created by the environment
 IStateInt makeInt()
          Factory pattern: new IStateInt objects are created by the environment (no initial value is assigned to the backtrackable search)
 IStateInt makeInt(int initialValue)
          Factory pattern: new IStateInt objects are created by the environment
 IStateInt makeIntProcedure(IStateIntProcedure procedure, int initialValue)
          Factory pattern : new IStateInt with procedure objects are created by the environment
 IStateIntVector makeIntVector()
          Factory pattern: new IStateIntVector objects are created by the environment.
 IStateIntVector makeIntVector(int[] entries)
          Factory pattern: new IStateIntVector objects are created by the environment
 IStateIntVector makeIntVector(int size, int initialValue)
          Factory pattern: new IStateIntVector objects are created by the environment
 IStateLong makeLong()
           
 IStateLong makeLong(int init)
           
 IStateLongVector makeLongVector()
          Factory pattern: new IStateIntVector objects are created by the environment.
 IStateLongVector makeLongVector(int size, long initialValue)
          Factory pattern: new IStateIntVector objects are created by the environment
 IStateLongVector makeLongVector(long[] entries)
          Factory pattern: new IStateIntVector objects are created by the environment
 IStateObject makeObject(Object obj)
           
<T> IStateVector<T>
makeVector()
          Factory pattern: new IStateVector objects are created by the environment.
 void worldCommit()
          Comitting the current world: merging it with the previous one.
 void worldPop()
          Backtracks to the previous choice point in the search tree.
 void worldPush()
          Starts a new branch in the search tree.
 
Methods inherited from class choco.kernel.memory.AbstractEnvironment
createSharedBipartiteSet, getNextOffset, getSharedBipartiteSetForBooleanVars, getWorldIndex, increaseSizeOfSharedBipartiteSet, makeBipartiteIntList, makeBipartiteSet, makeBipartiteSet, makeBipartiteSet, makeBipartiteSet, makeBitSet, makeIntInterval, makePartiallyStoredIntVector, makePartiallyStoredVector, makeStoredBipartiteList, makeStoredBipartiteList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

clonedWorldIdxStack

protected static final Stack<Integer> clonedWorldIdxStack

elements

public static RecomputableElement[][] elements

indices

public static int[] indices

nbCopy

public int nbCopy
Constructor Detail

EnvironmentCopying

public EnvironmentCopying()
Method Detail

getNbCopy

public int getNbCopy()

add

public void add(RecomputableElement rc)

worldPush

public void worldPush()
Description copied from interface: IEnvironment
Starts a new branch in the search tree.


worldPop

public void worldPop()
Description copied from interface: IEnvironment
Backtracks to the previous choice point in the search tree.


clear

public void clear()
Description copied from interface: IEnvironment
Clear the entire internal structures


worldCommit

public void worldCommit()
Description copied from interface: IEnvironment
Comitting the current world: merging it with the previous one.

Not used yet.


makeInt

public IStateInt makeInt()
Description copied from interface: IEnvironment
Factory pattern: new IStateInt objects are created by the environment (no initial value is assigned to the backtrackable search)

Returns:
new IStateInt computed by the environment

makeInt

public IStateInt makeInt(int initialValue)
Description copied from interface: IEnvironment
Factory pattern: new IStateInt objects are created by the environment

Parameters:
initialValue - the initial value of the backtrackable integer
Returns:
new IStateInt computed by the environment

makeIntProcedure

public IStateInt makeIntProcedure(IStateIntProcedure procedure,
                                  int initialValue)
Description copied from interface: IEnvironment
Factory pattern : new IStateInt with procedure objects are created by the environment

Parameters:
procedure - the procedure to apply
initialValue - the intial value of the integer
Returns:
IStateInt with procedure

makeBool

public IStateBool makeBool(boolean initialValue)
Description copied from interface: IEnvironment
Factory pattern: new IStateBool objects are created by the environment

Parameters:
initialValue - the initial value of the backtrackable boolean
Returns:
Boolean object created by the environment

makeIntVector

public IStateIntVector makeIntVector()
Description copied from interface: IEnvironment
Factory pattern: new IStateIntVector objects are created by the environment. Creates an empty vector

Returns:
IStateIntVector

makeIntVector

public IStateIntVector makeIntVector(int size,
                                     int initialValue)
Description copied from interface: IEnvironment
Factory pattern: new IStateIntVector objects are created by the environment

Parameters:
size - the number of entries in the vector
initialValue - the common initial value for all entries (backtrackable integers)
Returns:
IStateIntVector

makeIntVector

public IStateIntVector makeIntVector(int[] entries)
Description copied from interface: IEnvironment
Factory pattern: new IStateIntVector objects are created by the environment

Parameters:
entries - an array to be copied as set of initial contents of the vector
Returns:
IStateIntVector

makeLongVector

public IStateLongVector makeLongVector(int size,
                                       long initialValue)
Description copied from interface: IEnvironment
Factory pattern: new IStateIntVector objects are created by the environment

Parameters:
size - the number of entries in the vector
initialValue - the common initial value for all entries (backtrackable integers)
Returns:
IStateIntVector

makeLongVector

public IStateLongVector makeLongVector(long[] entries)
Description copied from interface: IEnvironment
Factory pattern: new IStateIntVector objects are created by the environment

Parameters:
entries - an array to be copied as set of initial contents of the vector
Returns:
IStateIntVector

makeLongVector

public IStateLongVector makeLongVector()
Description copied from interface: IEnvironment
Factory pattern: new IStateIntVector objects are created by the environment. Creates an empty vector

Returns:
IStateIntVector

makeDoubleVector

public IStateDoubleVector makeDoubleVector()
Description copied from interface: IEnvironment
Factory pattern: new IStateDoubleVector objects are created by the environment. Creates an empty vector

Returns:
IStateDoubleVector

makeDoubleVector

public IStateDoubleVector makeDoubleVector(int size,
                                           double initialValue)
Description copied from interface: IEnvironment
Factory pattern: new IStateDoubleVector objects are created by the environment

Parameters:
size - the number of entries in the vector
initialValue - the common initial value for all entries (backtrackable integers)
Returns:
IStateDoubleVector

makeDoubleVector

public IStateDoubleVector makeDoubleVector(double[] entries)
Description copied from interface: IEnvironment
Factory pattern: new IStateDoubleVector objects are created by the environment

Parameters:
entries - an array to be copied as set of initial contents of the vector
Returns:
IStateDoubleVector

makeFloat

public IStateDouble makeFloat()
Description copied from interface: IEnvironment
Factory pattern: new StoredFloat objects are created by the environment (no initial value is assigned to the backtrackable search)


makeFloat

public IStateDouble makeFloat(double initialValue)
Description copied from interface: IEnvironment
Factory pattern: new StoredFloat objects are created by the environment

Parameters:
initialValue - the initial value of the backtrackable search

makeLong

public IStateLong makeLong()

makeLong

public IStateLong makeLong(int init)

makeVector

public <T> IStateVector<T> makeVector()
Description copied from interface: IEnvironment
Factory pattern: new IStateVector objects are created by the environment. Creates an empty vector

Returns:
IStateIntVector

makeBinaryTree

public IStateBinaryTree makeBinaryTree(int inf,
                                       int sup)

makeObject

public IStateObject makeObject(Object obj)


Copyright © 2012. All Rights Reserved.