Durative Action #490
Replies: 1 comment 3 replies
-
Hi @antoniojbm So, for your first point, you are not telling the planner that You need a boolean fluent that says "barge_1 is currently bunkering a vessel, therefore it can't bunker another one". Here a code example that adds the is_bunkering = Fluent("is_bunkering", b=Barge)
# bunkering
bunkering = DurativeAction('bunkering', v=Vessel, b=Barge, p=Position)
v = bunkering.parameter('v')
b = bunkering.parameter('b')
p = bunkering.parameter('p')
bunkering.set_fixed_duration(bunkeringTime(v))
bunkering.add_condition(StartTiming(), Not(is_bunkering(b))) # <- new condition
bunkering.add_condition(StartTiming(), vessel_on(v, p))
bunkering.add_condition(StartTiming(), Not(isFueled(v)))
bunkering.add_condition(StartTiming(), barge_on(b, p))
bunkering.add_condition(StartTiming(), isDelta(p))
bunkering.add_effect(EndTiming(), isFueled(v), True)
# Extra effects
bunkering.add_effect(StartTiming(), is_bunkering(b), True)
bunkering.add_effect(EndTiming(), is_bunkering(b), False) Adding this you should get the expected result. (you also have to add the For the second part: what can you do with that? Currently we don't have any planner that gives temporal optimality guarantees. So, you can get a valid plan without any guarantees about the quality. |
Beta Was this translation helpful? Give feedback.
-
Hi, I have been trying to use DurativeAction for some time and I don't understand what it is for. My intention is that some ships have arrival time and bunkering times, from here the problems arise. It seems to work well but:
As you can see in the photo, if the left part is the start time of the action, why the bunkering is not adding that time? What am I doing wrong?
My second question is: What can I do with this? Can I optimize according to these times so that the scheduler always prioritizes the shortest ship time? For example, if there are two ships v1 takes 30 minutes to arrive and 15 minutes to bunkering, v2 takes 15 minutes to arrive and 15 minutes to bunkering, how can I make it take into account those times and take out first the ship that has taken less time?
My code is:
Beta Was this translation helpful? Give feedback.
All reactions