| java.lang.Object org.cougaar.logistics.plugin.demand.DemandForecastModule org.cougaar.logistics.plugin.demand.GenerateProjectionsExpander
GenerateProjectionsExpander | public class GenerateProjectionsExpander extends DemandForecastModule implements GenProjExpanderIfc(Code) | |
The default ProjectionsExpander for the DemandForecastPlugin.
This class expands a generate projections task into ProjectSupply tasks for all the
resource components (Parts,fuel,ammo) of the supply class needed by the GP's MEI.
|
Method Summary | |
protected void | addToAndPublishExpansion(Task parent, Collection subtasks) | protected Schedule | buildRateSchedule(PropertyGroup pg, Asset consumedItem, Schedule schedule, Asset consumer) | protected Collection | buildTaskList(PropertyGroup pg, Collection items, Schedule schedule, Task gpTask, Asset consumer) | public Workflow | buildWorkflow(Task parent, Collection subtasks) Build a workflow from a vector of tasks. | protected Asset | convertAggregateToAsset(Asset consumer) | protected void | createAndPublishExpansion(Task parent, Collection subtasks) | protected void | createDisposition(Task gpTask) | protected void | createGeolocPrepPhrases(Task parentTask, long end, Vector prepPhrases) | protected void | createMaintainingPrepPhrases(Object consumer, Vector prepPhrases) | protected Vector | createPrepPhrases(Object consumer, Task parentTask, long end, Schedule rate_schedule) Create FOR, TO, MAINTAIN, OFTYPE, and DEMANDRATE prepositional phrases
for use by the subclasses. | protected NewTask | createProjectSupplyTask(Task parentTask, Asset consumer, Asset consumedItem, long start, long end, Rate rate) | protected NewTask | createProjectSupplyTask(Task parentTask, Asset consumer, Asset consumedItem, Schedule rate_schedule) | protected Collection | diffProjections(Schedule published_schedule, Schedule newtask_schedule, TimeSpan timespan) Reconcile an intended schedule of projections with the
currently published schedule of projections so as to reuse as
many of the existing projection tasks as possible.
Generally as elements from the published schedule are used they
are removed from the schedule. | public void | expandGenerateProjections(Task gpTask, Schedule schedule, Asset consumer, TimeSpan timespan) Expand the passed in GenerateProjectins task into the requisite ProjectSupply
tasks - one for each resource need of this MEI/Asset determined by the
BG associated with the passed in supplyPGClass. | public Collection | getConsumed(PropertyGroup pg) | public double | getDailyQuantity(Rate r) | protected GeolocLocation | getGeolocLocation(Task parent_task, long time) | public Rate | getRate(PropertyGroup pg, Asset consumedItem, List params) | protected List | getRateParams(ObjectScheduleElement ose) | protected void | handleExpandedGpTask(Task gpTask, Schedule schedule, Asset consumer, PropertyGroup pg, TimeSpan timespan) | protected PrepositionalPhrase | newPrepositionalPhrase(String preposition, Object io) | protected String | printProjection(String msg, Task task) | public void | publishRemoveFromExpansion(Task subtask) | protected void | setEndTimePreference(NewTask task, long end) | protected void | setStartTimePreference(NewTask task, long start) | public void | updateAllocationResults(Collection planElements) |
addToAndPublishExpansion | protected void addToAndPublishExpansion(Task parent, Collection subtasks)(Code) | | |
buildWorkflow | public Workflow buildWorkflow(Task parent, Collection subtasks)(Code) | | Build a workflow from a vector of tasks.
Parameters: parent - parent task of workflow Parameters: subtasks - workflow tasks Workflow |
convertAggregateToAsset | protected Asset convertAggregateToAsset(Asset consumer)(Code) | | |
createAndPublishExpansion | protected void createAndPublishExpansion(Task parent, Collection subtasks)(Code) | | |
createDisposition | protected void createDisposition(Task gpTask)(Code) | | |
createGeolocPrepPhrases | protected void createGeolocPrepPhrases(Task parentTask, long end, Vector prepPhrases)(Code) | | |
createMaintainingPrepPhrases | protected void createMaintainingPrepPhrases(Object consumer, Vector prepPhrases)(Code) | | |
createPrepPhrases | protected Vector createPrepPhrases(Object consumer, Task parentTask, long end, Schedule rate_schedule)(Code) | | Create FOR, TO, MAINTAIN, OFTYPE, and DEMANDRATE prepositional phrases
for use by the subclasses.
Parameters: consumer - the consumer the task supports Vector of PrepostionalPhrases |
createProjectSupplyTask | protected NewTask createProjectSupplyTask(Task parentTask, Asset consumer, Asset consumedItem, long start, long end, Rate rate)(Code) | | |
diffProjections | protected Collection diffProjections(Schedule published_schedule, Schedule newtask_schedule, TimeSpan timespan)(Code) | | Reconcile an intended schedule of projections with the
currently published schedule of projections so as to reuse as
many of the existing projection tasks as possible.
Generally as elements from the published schedule are used they
are removed from the schedule. Tasks remaining in the schedule
are rescinded.
There are three regions of interest: before now, around now and
after now. These are each handled separately. In the region
before now, already published tasks are unconditionally
retained and new tasks are unconditionally ignored.
In the region around now, tasks may start before now and end
after. If both a published task and a new task spanning now
exist, then there are two cases: If the demand rates are the
same, then the published task is changed to look like the new
task (by changing its end time preference). The start time of
the published task is unchanged. Think of the existing task
ending now and the new task starting now and then splicing the
two together into one task. If the rates are different, then
the existing task must end when the new task starts. The
current code accomplishes this by setting the end time
preference of the existing task to the start time of the new.
This is not exactly correct since we shouldn't change the past.
The times of the tasks should be no less than now.
In the region after now, we try to match up the tasks. When a
match is possible, the existing task is changed if necessary
(and republished) otherwise it is rescinded and the new task
added.
|
expandGenerateProjections | public void expandGenerateProjections(Task gpTask, Schedule schedule, Asset consumer, TimeSpan timespan)(Code) | | Expand the passed in GenerateProjectins task into the requisite ProjectSupply
tasks - one for each resource need of this MEI/Asset determined by the
BG associated with the passed in supplyPGClass.
|
getDailyQuantity | public double getDailyQuantity(Rate r)(Code) | | |
publishRemoveFromExpansion | public void publishRemoveFromExpansion(Task subtask)(Code) | | |
setEndTimePreference | protected void setEndTimePreference(NewTask task, long end)(Code) | | |
setStartTimePreference | protected void setStartTimePreference(NewTask task, long start)(Code) | | |
updateAllocationResults | public void updateAllocationResults(Collection planElements)(Code) | | |
|
|