| java.lang.Object org.cougaar.logistics.plugin.inventory.InventoryModule org.cougaar.logistics.plugin.inventory.DiffBasedComparator
DiffBasedComparator | public class DiffBasedComparator extends InventoryModule implements ComparatorModule(Code) | | The DiffBasedComparator compares both the set of old refills and new
refills. The goal of this module is to reduce the number of changes
replans make on the blackboard. It accomplishes this by finding published
tasks that are identical to just created tasks. The code will also try
and modify an existing task that is similar to the the newly created task
as opposed to to rescinding the published task and publishing the new task.
Of course, if no published task can be found during the appropriate time span
of the new task, the new task is published. Any unaccounted for published
tasks will be rescinded.
Called by the Refill Generator with the new refills and old refills.
|
Method Summary | |
public void | compareRefillProjections(ArrayList newRefillProjs, ArrayList oldRefillProjs, Inventory inv) Compares the old and new Refill Projection tasks.
A schedule is created from the previously published projections. | public void | compareRefills(ArrayList newRefills, ArrayList oldRefills, Inventory inv) Compares the old and new Refill tasks.
The previously published refills are bucketized which means they are
flagged as belonging in a certain bucket. |
DiffBasedComparator | public DiffBasedComparator(InventoryManager imPlugin)(Code) | | Need to pass in the IM Plugin for now to get services
and util classes.
|
compareRefillProjections | public void compareRefillProjections(ArrayList newRefillProjs, ArrayList oldRefillProjs, Inventory inv)(Code) | | Compares the old and new Refill Projection tasks.
A schedule is created from the previously published projections. New tasks
are compared to the schedule in order to identify overlapping tasks. In
cases where overlapping tasks are found, the published task is changed to
convey the information of the new task. If the tasks are identical no changes
are made to the blackboard. New tasks which have no overlap with existing
tasks are published and published refills which have not been accounted for
are rescinded.
Parameters: newRefillProjs - The collection of newly generated Refill Projectionsfrom the RefillProjectionsGenerator Module Parameters: oldRefillProjs - The previously generated Refill Projection Tasks Parameters: inv - The Inventory the Refills Projections are refilling. |
compareRefills | public void compareRefills(ArrayList newRefills, ArrayList oldRefills, Inventory inv)(Code) | | Compares the old and new Refill tasks.
The previously published refills are bucketized which means they are
flagged as belonging in a certain bucket. Each new task is examined to
determine the bucket in which it would belong. If a previously published
task is found to occupy the same bucket as a new task, those tasks are
then compared. If the tasks are identical, no blackboard action is taken.
Otherwise, the published task is changed to take on the characteristics
of the new task and the new task is discarded. If no refill occupies the
same bucket as a new refill task, that task is published. Any unaccounted
for published tasks are rescinded.
Parameters: newRefills - The collection of newly generated Refills from theRefillGeneratorModule Parameters: oldRefills - The previously generated Refill Tasks Parameters: inv - The Inventory the Refills are refilling. |
|
|