% Suppress singleton warnings :- set_flag(variable_names, on). % Load the interpreter :- ["interpreter/online57.ecl"]. % Load the domain model :- ["model.ecl"]. % Load the controls (ie, Golog procedures and reward functions) :- ["control.ecl"]. % Load the environment simulator :- ["envsim.ecl"]. % Turn off the dynamic flag, so that tracer window will work :- set_flag(all_dynamic, off). % Define some compound queries manual(Duration):- sim_reset, ["reward1.ecl"], online(allocResManual(Duration) : nil, s0, inf, Pol, V), retract(reward(_, _)), sim_print_stats. auto(Duration):- sim_reset, ["reward1.ecl"], online(allocResAuto(Duration) : nil, s0, inf, Pol, V), retract(reward(_, _)), sim_print_stats. optimal(Duration):- sim_reset, ["reward2.ecl"], online(allocResAuto(Duration) : nil, s0, inf, Pol, V), retract(reward(_, _)), sim_print_stats. % Finally, give a hint! :- nl, nl, write("To run, please call one of these:\n manual(10000). auto(10000). optimal(10000). "), nl, nl. % This is a proof that nearest car can be found. % :- holds(isARegion(Region) & validXCoord(Region, X) & validYCoord(Region, Y) & requestPending(loc(X, Y)) & isACar(Ncar) & homeRegion(Ncar, Region) & ready(Ncar) & carLocKnown(Ncar) & carLocation(Ncar, NLoc) & distance(NLoc, loc(X,Y), NDist) & all(otherCar, all(otherLoc, all(otherDist, ( (isACar(otherCar) & homeRegion(otherCar, Region) & ready(otherCar) & carLocKnown(otherCar) & carLocation(otherCar, otherLoc) & distance(otherLoc, loc(X,Y), otherDist)) => otherDist >= NDist) ))), do(reportReady(c5, loc(1, 12), 61), do(mobilizeS(c3, loc(1, 12), 60), do(request(loc(1, 11), 60), do(wait(0), s0))))). % Start simulation runs :- ["simcalls.ecl"].