choco.kernel.memory
Class AbstractEnvironment

java.lang.Object
  extended by choco.kernel.memory.AbstractEnvironment
All Implemented Interfaces:
IEnvironment
Direct Known Subclasses:
EnvironmentCopying, EnvironmentTrailing

public abstract class AbstractEnvironment
extends Object
implements IEnvironment

Super class of all environments !


Field Summary
 IStateIntVector currentBitSet
          Shared BitSet
protected  int currentWorld
          The current world index.
protected  int nextOffset
          Nex free bit in the shared BitSet
 
Fields inherited from interface choco.kernel.memory.IEnvironment
LOGGER
 
Constructor Summary
AbstractEnvironment()
           
 
Method Summary
 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 StoredBitSetVector objects 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
 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
 IntInterval makeIntInterval(int inf, int sup)
          Factory pattern : new IntInterval objects are created by the environment
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface choco.kernel.memory.IEnvironment
clear, makeBinaryTree, makeBool, makeDoubleVector, makeDoubleVector, makeDoubleVector, makeFloat, makeFloat, makeInt, makeInt, makeIntProcedure, makeIntVector, makeIntVector, makeIntVector, makeLong, makeLong, makeLongVector, makeLongVector, makeLongVector, makeObject, makeVector, worldCommit, worldPop, worldPush
 

Field Detail

currentWorld

protected int currentWorld
The current world index.


currentBitSet

public IStateIntVector currentBitSet
Shared BitSet


nextOffset

protected int nextOffset
Nex free bit in the shared BitSet

Constructor Detail

AbstractEnvironment

public AbstractEnvironment()
Method Detail

getWorldIndex

public final int getWorldIndex()
Description copied from interface: IEnvironment
Returns the world number.

Specified by:
getWorldIndex in interface IEnvironment
Returns:
current world index

createSharedBipartiteSet

public final void createSharedBipartiteSet(int size)
Description copied from interface: IEnvironment
Build a shared bipartite set

Specified by:
createSharedBipartiteSet in interface IEnvironment
Parameters:
size - size of the bi partite set

getSharedBipartiteSetForBooleanVars

public final IStateIntVector getSharedBipartiteSetForBooleanVars()
Factory pattern : shared StoredBitSetVector objects is return by the environment

Specified by:
getSharedBipartiteSetForBooleanVars in interface IEnvironment
Returns:

getNextOffset

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

Specified by:
getNextOffset in interface IEnvironment
Returns:

makeStoredBipartiteList

public <E> StoredBipartiteSet makeStoredBipartiteList(Collection<E> coll)
Specified by:
makeStoredBipartiteList in interface IEnvironment

makeStoredBipartiteList

public <E> StoredBipartiteSet makeStoredBipartiteList(E[] elm)
Specified by:
makeStoredBipartiteList in interface IEnvironment

makeBipartiteIntList

public IStateIntVector makeBipartiteIntList(int[] entries)
Specified by:
makeBipartiteIntList in interface IEnvironment

makeBipartiteSet

public IStateIntVector makeBipartiteSet(int[] entries)
Specified by:
makeBipartiteSet in interface IEnvironment

makeBipartiteSet

public IStateIntVector makeBipartiteSet(int nbEntries)
Specified by:
makeBipartiteSet in interface IEnvironment

makeBipartiteSet

public IStateIntVector makeBipartiteSet(IndexedObject[] entries)
Specified by:
makeBipartiteSet in interface IEnvironment

makeBipartiteSet

public IStateIntVector makeBipartiteSet(ArrayList<IndexedObject> entries)
Specified by:
makeBipartiteSet in interface IEnvironment

makePartiallyStoredVector

public <T> PartiallyStoredVector<T> makePartiallyStoredVector()
Description copied from interface: IEnvironment
Factory pattern : create a new partially stored vector via the environment.

Specified by:
makePartiallyStoredVector in interface IEnvironment
Type Parameters:
T - object to store
Returns:
PartiallyStoredVector

makePartiallyStoredIntVector

public PartiallyStoredIntVector makePartiallyStoredIntVector()
Description copied from interface: IEnvironment
Factory pattern : create a new partially stored int vector via the environment.

Specified by:
makePartiallyStoredIntVector in interface IEnvironment
Returns:
PartiallyStoredVector

makeIntInterval

public IntInterval makeIntInterval(int inf,
                                   int sup)
Description copied from interface: IEnvironment
Factory pattern : new IntInterval objects are created by the environment

Specified by:
makeIntInterval in interface IEnvironment
Parameters:
inf - intitial lower bound
sup - intial upper bound
Returns:
new IntInterval computed by the environment

makeBitSet

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

Specified by:
makeBitSet in interface IEnvironment
Parameters:
size - initail size of the IStateBitSet
Returns:
IStateBitSet

increaseSizeOfSharedBipartiteSet

public 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

Specified by:
increaseSizeOfSharedBipartiteSet in interface IEnvironment
Parameters:
gap - the gap the reach the expected size


Copyright © 2012. All Rights Reserved.