choco.kernel.memory
Interface IEnvironment

All Known Implementing Classes:
AbstractEnvironment, EnvironmentCopying, EnvironmentTrailing

public interface IEnvironment


Field Summary
static Logger LOGGER
          Reference to an object for logging trace statements related memory & backtrack (using the java.util.logging package)
 
Method Summary
 void clear()
          Clear the entire internal structures
 void createSharedBipartiteSet(int size)
          Build a shared bipartite set
 int getNextOffset()
          Return the next free bit in the shared StoredBitSetVector object
 IStateIntVector getSharedBipartiteSetForBooleanVars()
          Factory pattern : shared IStateIntVector object is return by the environment
 int getWorldIndex()
          Returns the world number.
 void increaseSizeOfSharedBipartiteSet(int gap)
          Increase the size of the shared bi partite set, it HAS to be called before the end of the environment creation BEWARE: be sure you are correctly calling this method
 IStateBinaryTree makeBinaryTree(int inf, int sup)
           
 IStateIntVector makeBipartiteIntList(int[] entries)
           
 IStateIntVector makeBipartiteSet(ArrayList<IndexedObject> entries)
           
 IStateIntVector makeBipartiteSet(IndexedObject[] entries)
           
 IStateIntVector makeBipartiteSet(int nbEntries)
           
 IStateIntVector makeBipartiteSet(int[] entries)
           
 IStateBitSet makeBitSet(int size)
          Factory pattern: new IStateBitSet objects are created by the environment
 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
 IntInterval makeIntInterval(int lowB, int upB)
          Factory pattern : new IntInterval 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)
           
 PartiallyStoredIntVector makePartiallyStoredIntVector()
          Factory pattern : create a new partially stored int vector via the environment.
<T> PartiallyStoredVector<T>
makePartiallyStoredVector()
          Factory pattern : create a new partially stored vector via the environment.
<E> StoredBipartiteSet
makeStoredBipartiteList(Collection<E> coll)
           
<E> StoredBipartiteSet
makeStoredBipartiteList(E[] elm)
           
<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.
 

Field Detail

LOGGER

static final Logger LOGGER
Reference to an object for logging trace statements related memory & backtrack (using the java.util.logging package)

Method Detail

getWorldIndex

int getWorldIndex()
Returns the world number.

Returns:
current world index

worldPush

void worldPush()
Starts a new branch in the search tree.


worldPop

void worldPop()
Backtracks to the previous choice point in the search tree.


worldCommit

void worldCommit()
Comitting the current world: merging it with the previous one.

Not used yet.


clear

void clear()
Clear the entire internal structures


makeInt

IStateInt makeInt()
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

IStateInt makeInt(int initialValue)
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

makeIntInterval

IntInterval makeIntInterval(int lowB,
                            int upB)
Factory pattern : new IntInterval objects are created by the environment

Parameters:
lowB - intitial lower bound
upB - intial upper bound
Returns:
new IntInterval computed by the environment

makeIntProcedure

IStateInt makeIntProcedure(IStateIntProcedure procedure,
                           int initialValue)
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

IStateBool makeBool(boolean initialValue)
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

IStateIntVector makeIntVector()
Factory pattern: new IStateIntVector objects are created by the environment. Creates an empty vector

Returns:
IStateIntVector

makeIntVector

IStateIntVector makeIntVector(int size,
                              int initialValue)
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

IStateIntVector makeIntVector(int[] entries)
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

IStateLongVector makeLongVector()
Factory pattern: new IStateIntVector objects are created by the environment. Creates an empty vector

Returns:
IStateIntVector

makeLongVector

IStateLongVector makeLongVector(int size,
                                long initialValue)
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

IStateLongVector makeLongVector(long[] entries)
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

IStateDoubleVector makeDoubleVector()
Factory pattern: new IStateDoubleVector objects are created by the environment. Creates an empty vector

Returns:
IStateDoubleVector

makeDoubleVector

IStateDoubleVector makeDoubleVector(int size,
                                    double initialValue)
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

IStateDoubleVector makeDoubleVector(double[] entries)
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

<T> IStateVector<T> makeVector()
Factory pattern: new IStateVector objects are created by the environment. Creates an empty vector

Returns:
IStateIntVector

makePartiallyStoredVector

<T> PartiallyStoredVector<T> makePartiallyStoredVector()
Factory pattern : create a new partially stored vector via the environment.

Type Parameters:
T - object to store
Returns:
PartiallyStoredVector

makePartiallyStoredIntVector

PartiallyStoredIntVector makePartiallyStoredIntVector()
Factory pattern : create a new partially stored int vector via the environment.

Returns:
PartiallyStoredVector

makeBitSet

IStateBitSet makeBitSet(int size)
Factory pattern: new IStateBitSet objects are created by the environment

Parameters:
size - initail size of the IStateBitSet
Returns:
IStateBitSet

createSharedBipartiteSet

void createSharedBipartiteSet(int size)
Build a shared bipartite set

Parameters:
size - size of the bi partite set

getSharedBipartiteSetForBooleanVars

IStateIntVector getSharedBipartiteSetForBooleanVars()
Factory pattern : shared IStateIntVector object is return by the environment

Returns:
IStateIntVector

increaseSizeOfSharedBipartiteSet

void increaseSizeOfSharedBipartiteSet(int gap)
Increase the size of the shared bi partite set, it HAS to be called before the end of the environment creation BEWARE: be sure you are correctly calling this method

Parameters:
gap - the gap the reach the expected size

getNextOffset

int getNextOffset()
Return the next free bit in the shared StoredBitSetVector object

Returns:

makeStoredBipartiteList

<E> StoredBipartiteSet makeStoredBipartiteList(Collection<E> coll)

makeStoredBipartiteList

<E> StoredBipartiteSet makeStoredBipartiteList(E[] elm)

makeBipartiteIntList

IStateIntVector makeBipartiteIntList(int[] entries)

makeBipartiteSet

IStateIntVector makeBipartiteSet(int[] entries)

makeBipartiteSet

IStateIntVector makeBipartiteSet(int nbEntries)

makeBipartiteSet

IStateIntVector makeBipartiteSet(IndexedObject[] entries)

makeBipartiteSet

IStateIntVector makeBipartiteSet(ArrayList<IndexedObject> entries)

makeFloat

IStateDouble makeFloat()
Factory pattern: new StoredFloat objects are created by the environment (no initial value is assigned to the backtrackable search)


makeLong

IStateLong makeLong()

makeLong

IStateLong makeLong(int init)

makeFloat

IStateDouble makeFloat(double initialValue)
Factory pattern: new StoredFloat objects are created by the environment

Parameters:
initialValue - the initial value of the backtrackable search

makeBinaryTree

IStateBinaryTree makeBinaryTree(int inf,
                                int sup)

makeObject

IStateObject makeObject(Object obj)


Copyright © 2012. All Rights Reserved.