choco.kernel.memory.trailing
Class EnvironmentTrailing

java.lang.Object
  extended by choco.kernel.memory.AbstractEnvironment
      extended by choco.kernel.memory.trailing.EnvironmentTrailing
All Implemented Interfaces:
IEnvironment

public final class EnvironmentTrailing
extends AbstractEnvironment

The root class for managing memory and sessions.

A environment is associated to each problem. It is responsible for managing backtrackable data.


Field Summary
 
Fields inherited from class choco.kernel.memory.AbstractEnvironment
currentBitSet, currentWorld, nextOffset
 
Fields inherited from interface choco.kernel.memory.IEnvironment
LOGGER
 
Constructor Summary
EnvironmentTrailing()
          Constructs a new IEnvironment with the default stack sizes : 50000 and 1000.
 
Method Summary
 void clear()
          Clear the entire internal structures
 StoredBinaryTreeTrail getBinaryTreeTrail()
           
protected  StoredBoolTrail getBoolTrail()
           
protected  StoredDoubleTrail getDoubleTrail()
           
protected  StoredDoubleVectorTrail getDoubleVectorTrail()
           
protected  StoredIntTrail getIntTrail()
           
protected  StoredIntVectorTrail getIntVectorTrail()
           
protected  StoredLongTrail getLongTrail()
           
protected  StoredLongVectorTrail getLongVectorTrail()
           
 int getTrailSize()
           
protected  StoredVectorTrail getVectorTrail()
           
 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
 

Constructor Detail

EnvironmentTrailing

public EnvironmentTrailing()
Constructs a new IEnvironment with the default stack sizes : 50000 and 1000.

Method Detail

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.


worldCommit

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

Not used yet.


clear

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


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()
Description copied from interface: IEnvironment
Factory pattern: new IStateIntVector objects are created by the environment. Creates an empty 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

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

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

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

makeBinaryTree

public IStateBinaryTree makeBinaryTree(int inf,
                                       int sup)

makeLong

public IStateLong makeLong()

makeLong

public IStateLong makeLong(int init)

makeObject

public IStateObject makeObject(Object obj)

getTrailSize

public int getTrailSize()

getIntTrail

protected StoredIntTrail getIntTrail()

getLongTrail

protected StoredLongTrail getLongTrail()

getBoolTrail

protected StoredBoolTrail getBoolTrail()

getDoubleTrail

protected StoredDoubleTrail getDoubleTrail()

getVectorTrail

protected StoredVectorTrail getVectorTrail()

getIntVectorTrail

protected StoredIntVectorTrail getIntVectorTrail()

getDoubleVectorTrail

protected StoredDoubleVectorTrail getDoubleVectorTrail()

getLongVectorTrail

protected StoredLongVectorTrail getLongVectorTrail()

getBinaryTreeTrail

public StoredBinaryTreeTrail getBinaryTreeTrail()


Copyright © 2012. All Rights Reserved.