java.lang.Object
org.maxicp.cp.engine.constraints.Profile
Representation of a cumulated Profile
data structure as a contiguous sequence of
Profile.Rectangle
built from a set of Profile.Rectangle using a sweep-line algorithm.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.maxicp.cp.engine.constraints.Profile.Rectangleget(int i) intrectangleIndex(int t) Retrieves the rectangle index of the profile that overlaps a given time.org.maxicp.cp.engine.constraints.Profile.Rectangle[]Get the cumulated Profile from the rectangles passed in argument to the constructor.intsize()Return the number of rectangles in the profile.toString()
-
Constructor Details
-
Profile
public Profile(org.maxicp.cp.engine.constraints.Profile.Rectangle... rectangles)
-
-
Method Details
-
rectangles
public org.maxicp.cp.engine.constraints.Profile.Rectangle[] rectangles()Get the cumulated Profile from the rectangles passed in argument to the constructor.- Returns:
- the cumulated profile is a contiguous sequence of
Profile.Rectangle
-
rectangleIndex
public int rectangleIndex(int t) Retrieves the rectangle index of the profile that overlaps a given time.- Parameters:
t- the time at which we want to retrieve the overlapping rectangle- Returns:
- the rectangle index r of the profile such that
r.start <= tandr.end > t
-
size
public int size()Return the number of rectangles in the profile.- Returns:
- the number of rectangles in the profile
-
get
public org.maxicp.cp.engine.constraints.Profile.Rectangle get(int i) - Parameters:
i- the rectangle index- Returns:
- the rectangle of the profile at index i
- See Also:
-
toString
-