| java.lang.Object org.cougaar.logistics.plugin.packer.AggregationClosure
All known Subclasses: org.cougaar.logistics.plugin.packer.AmmoTransport,
AggregationClosure | abstract public class AggregationClosure (Code) | | This class is used to wrap up an aggregation's state into an
object that is able to generate new MPTasks on demand. These
MPTasks will be used as the "right-hand-side" of Aggregations
constructed by the GenericPlugin.
A standard strategy for writing AggregationClosures is to provide
a constructor that sets a number of instance variables. Then the newTask method
will use these instance variables to appropriately construct the MPTask it
returns.
The name of this class is a trifle unfortunate --- it would be
better if it and the GenericTemplate were renamed to MPTaskTemplate
and WorkflowTemplate, respectively, but this has not been done in the
interests of backward-compatibility.
See Also: GenericPlugin |
Method Summary | |
abstract public double | getQuantity() | abstract public NewMPTask | newTask() Developers of aggregation and packing rules should supply an
AggregationClosure subclass that provides an instantiation of this
method. | public void | setGenericPlugin(GenericPlugin gp) This method will be called by aggregation and packing scripts of
the scripting Plugin. | abstract public boolean | validTask(Task task) return true if task is valid for this AggregationClosure. |
getQuantity | abstract public double getQuantity()(Code) | | getQuantity - return the amount this container can hold
|
newTask | abstract public NewMPTask newTask()(Code) | | Developers of aggregation and packing rules should supply an
AggregationClosure subclass that provides an instantiation of this
method. This method should return a NewMPTask, but need not publish
it (this will be done by the GenericPlugin) or set its Preferences
(this is the job of the PreferenceAggregator.
See Also: PreferenceAggregator |
setGenericPlugin | public void setGenericPlugin(GenericPlugin gp)(Code) | | This method will be called by aggregation and packing scripts of
the scripting Plugin. It is guaranteed to be called before the
newTask method is called, so that writers of newTask methods may
feel free to use the variables _gp and _factory, that point to the
GenericPlugin and its PlanningFactory, respectively.
See Also: AggregationClosure.newTask |
validTask | abstract public boolean validTask(Task task)(Code) | | return true if task is valid for this AggregationClosure.
|
|
|