Friday, February 13, 2009

Implementation Diary - 14 Feb 2009

One problem that often occurs in planning in Crackpot is two same actions (needing same preconditions) occurring concurrently. For example, two LoadPackageIntoTruckAtDepot(package_3, into: Truck1) actions occurring at time 6 and 12.

At 6: of type: LoadPackageIntoTruckAtDepot
: Duration: 10
ConditionInstances: [
@[6,7): Package_3 of type: package.packageLocation == Truck_1 of type: truck.truckInDepot
]
ContributionInstances: [
@[16,2147483647): Package_3 of type: package.packageLocation <- Truck_1 of type: truck (type OBJECT_REFERENCE)
]
ActionTaskInstances: [
]

At 12: of type: LoadPackageIntoTruckAtDepot
: Duration: 10
ConditionInstances: [
@[12,13): Package_3 of type: package.packageLocation == Truck_1 of type: truck.truckInDepot
]
ContributionInstances: [
@[22,2147483647): Package_3 of type: package.packageLocation <- Truck_1 of type: truck (type OBJECT_REFERENCE)
]
ActionTaskInstances: [
]

The way to eliminate this error is to introduce an Actuator "TruckBusy" within each truck that gets used when it is being loaded. The same Actuator is used when the truck is running and unloaded. This is one thing I did today.

Note that here we introduced the Actuator as an afterthought of observing a plan. This happened because Actuators are somewhat unobvious in actions.

It usually does not make sense that the same action (instantiated with the same parameters) are carried out again concurrently. For example, "opening the same door twice simultaneously" is non-sense. All such actions should contain Actuators.

No comments:

Post a Comment