|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractSet<Task>
logist.task.TaskSet
public abstract class TaskSet
A specialized Set implementation for use with Task objects. All
elements in a TaskSet must come from the same task batch that is generated
before each simulation round. TaskSet are represented internally as bit
vectors.
The iterator returned by the iteratormethod traverses the elements in order of increasing task id.
Note that TaskSets or Tasks from different round are not compatible and cannot be combined.
The implementation of this class is based on Joshua Bloch's EnumSet from the Java Collections Framework.
| Method Summary | |
|---|---|
TaskSet |
clone()
Returns a copy of this set. |
static TaskSet |
copyOf(TaskSet s)
Creates a new task set containing the same elements as the specified task set. |
static TaskSet |
create(Task[] universe)
For system use only. |
static TaskSet |
intersect(TaskSet s1,
TaskSet s2)
Creates a new task set containing the intersection of two task sets. |
static TaskSet |
intersectComplement(TaskSet s1,
TaskSet s2)
Creates a new task set containing the intersection of a task set with the complement of another task set. |
abstract java.util.Iterator<Task> |
iterator()
Returns an iterator over the elements contained in this set. |
static TaskSet |
noneOf(TaskSet s)
Creates an empty task set ranging over the same universe as the specified task set. |
int |
rewardSum()
Sums the rewards of all tasks. |
java.lang.String |
toString()
|
static TaskSet |
union(TaskSet s1,
TaskSet s2)
Creates a new task set containing the union of two task sets. |
int |
weightSum()
Sums the weights of all tasks. |
| Methods inherited from class java.util.AbstractSet |
|---|
equals, hashCode, removeAll |
| Methods inherited from class java.util.AbstractCollection |
|---|
add, addAll, clear, contains, containsAll, isEmpty, remove, retainAll, size, toArray, toArray |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Set |
|---|
add, addAll, clear, contains, containsAll, isEmpty, remove, retainAll, size, toArray, toArray |
| Method Detail |
|---|
public static TaskSet create(Task[] universe)
universe -
java.lang.IllegalArgumentException - if some task id does not match with the index in the tablepublic static TaskSet copyOf(TaskSet s)
s - the collection from which to initialize this task setpublic static TaskSet noneOf(TaskSet s)
s - the collection from which to initialize this task set
public static TaskSet union(TaskSet s1,
TaskSet s2)
s1 - s2 -
java.lang.IllegalArgumentException - if s1 and s2 are task sets from different rounds
public static TaskSet intersect(TaskSet s1,
TaskSet s2)
s1 - s2 -
java.lang.IllegalArgumentException - if s1 and s2 are task sets from different rounds
public static TaskSet intersectComplement(TaskSet s1,
TaskSet s2)
s1 - s2 -
java.lang.IllegalArgumentException - if s1 and s2 are task sets from different roundspublic int weightSum()
public int rewardSum()
public abstract java.util.Iterator<Task> iterator()
iterator in interface java.lang.Iterable<Task>iterator in interface java.util.Collection<Task>iterator in interface java.util.Set<Task>iterator in class java.util.AbstractCollection<Task>public java.lang.String toString()
toString in class java.util.AbstractCollection<Task>public TaskSet clone()
clone in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||