Package org.jacop.constraints
Class Profile
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<ProfileItem>
,Collection<ProfileItem>
,List<ProfileItem>
,RandomAccess
- Direct Known Subclasses:
DiffnProfile
Defines a basic data structure to keep the profile for the diffn/1 and
cumulative/4 constraints. It consists of ordered pair of time points and the
current value.
- Version:
- 4.9
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int
(package private) static final int
protected int
private static final long
(package private) static final boolean
(package private) short
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addToProfile
(int a, int b, int val) It adds given amount (val) to the profile between a and b.int
max()
It returns the max height of the profile item encountered in the profile.toString()
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
containsAll
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
trace
static final boolean trace- See Also:
-
cumul
static final int cumul- See Also:
-
diffn
static final int diffn- See Also:
-
maxProfileItemHeight
protected int maxProfileItemHeight -
type
short type
-
-
Constructor Details
-
Profile
public Profile()It constructs the prophet file. -
Profile
public Profile(short type) It constructs the profile of a given type (e.g. for cumulative).- Parameters:
type
- type of the profile (cumul=0, diffn=1)
-
-
Method Details
-
addToProfile
public void addToProfile(int a, int b, int val) It adds given amount (val) to the profile between a and b.- Parameters:
a
- the minimum range at which it is being added.b
- the maximum range at which it is being added.val
- the amount by which the profiles is updated.
-
max
public int max()It returns the max height of the profile item encountered in the profile.- Returns:
- the max height.
-
toString
- Overrides:
toString
in classAbstractCollection<ProfileItem>
-