(FILECREATED "13-NOV-83 18:32:54" {INDIGO}<LOOPS>TRUCKIN>MULTI>PLANNER.;10   50674

      changes to:  (METHODS Planner.AtCurrentStop Planner.Buy Planner.BuyGas Planner.CarryOutGoal 
			    Planner.FindStoppingPlace Planner.GetClose Planner.GoToAlice 
			    Planner.GoToStoppingPlace Planner.LeaveAlice Planner.PurchaseGas 
			    Planner.RateDumps Planner.RateGasStations Planner.Sell Planner.SellGoods 
			    Planner.SetGoal Planner.SitTight Planner.TakeTurn)

      previous date: " 1-NOV-83 17:14:45" {INDIGO}<LOOPS>TRUCKIN>MULTI>PLANNER.;9)


(PRETTYCOMPRINT PLANNERCOMS)

(RPAQQ PLANNERCOMS ((CLASSES Planner)
	(METHODS Planner.AtCurrentStop Planner.Buy Planner.BuyGas Planner.CarryOutGoal 
		 Planner.FindStoppingPlace Planner.GetClose Planner.GoToAlice 
		 Planner.GoToStoppingPlace Planner.LeaveAlice Planner.PurchaseGas Planner.RateDumps 
		 Planner.RateGasStations Planner.Sell Planner.SellGoods Planner.SetGoal 
		 Planner.SitTight Planner.TakeTurn)
	(FNS AtCurrentStopPlanner BuyGasPlanner BuyPlanner CarryOutGoalPlanner 
	     FindStoppingPlacePlannerRules GetClosePlanner GoToAlicePlanner 
	     GoToStoppingPlacePlannerRules LeaveAlicePlanner PurchaseGasPlanner RateDumpsPlanner 
	     RateGasStationsPlannerRules SellGoodsPlannerRules SellPlanner SetGoalPlanner 
	     SitTightPlanner TakeTurnPlannerRules)
	(INSTANCES AtCurrentStopPlanner BuyGasPlanner BuyPlanner CarryOutGoalPlanner 
		   FindStoppingPlacePlannerRules GetClosePlanner GoToAlicePlanner 
		   GoToStoppingPlacePlannerRules LeaveAlicePlanner PurchaseGasPlanner 
		   RateDumpsPlanner RateGasStationsPlannerRules SellGoodsPlannerRules SellPlanner 
		   SetGoalPlanner SitTightPlanner TakeTurnPlannerRules)))
(DEFCLASSES Planner)
[DEFCLASS Planner
   (MetaClass PlayerMeta Edited:                             (* sm: "23-JUN-83 12:40"))
   (Supers Peddler)
   (ClassVariables (CopyCV (Icon))
		   (Icon ?))
   (InstanceVariables (goal Buy)
		      (higherGoal Buy doc                    (* main goal if temporarily overridden))
		      (prevGoal NIL)
		      (sellers NIL))]

[METH Planner  AtCurrentStop NIL
      NIL (method AtCurrentStopPlanner RuleSet AtCurrentStopPlanner)]


[METH Planner  Buy NIL
      NIL (method BuyPlanner RuleSet BuyPlanner)]


[METH Planner  BuyGas NIL
      NIL (method BuyGasPlanner RuleSet BuyGasPlanner)]


[METH Planner  CarryOutGoal NIL
      NIL (method CarryOutGoalPlanner RuleSet CarryOutGoalPlanner)]


[METH Planner  FindStoppingPlace NIL
      (* RuleSet FindStoppingPlacePeddlerRules is installed as the selector FindStoppingPlace of the 
	 class Peddler)
      (method FindStoppingPlacePlannerRules RuleSet FindStoppingPlacePlannerRules)]


[METH Planner  GetClose NIL
      NIL (method GetClosePlanner RuleSet GetClosePlanner)]


[METH Planner  GoToAlice NIL
      NIL (method GoToAlicePlanner RuleSet GoToAlicePlanner)]


[METH Planner  GoToStoppingPlace NIL
      (* RuleSet GoToStoppingPlacePeddlerRules is installed as the selector GoToStoppingPlace of the 
	 class Peddler)
      (method GoToStoppingPlacePlannerRules RuleSet GoToStoppingPlacePlannerRules)]


[METH Planner  LeaveAlice NIL
      NIL (method LeaveAlicePlanner RuleSet LeaveAlicePlanner)]


[METH Planner  PurchaseGas NIL
      NIL (method PurchaseGasPlanner RuleSet PurchaseGasPlanner)]


[METH Planner  RateDumps NIL
      NIL (method RateDumpsPlanner RuleSet RateDumpsPlanner)]


[METH Planner  RateGasStations NIL
      NIL (method RateGasStationsPlannerRules RuleSet RateGasStationsPlannerRules)]


[METH Planner  Sell NIL
      NIL (method SellPlanner RuleSet SellPlanner)]


[METH Planner  SellGoods NIL
      (* RuleSet SellGoodsPeddlerRules is installed as the selector SellGoods of the class Peddler)
      (method SellGoodsPlannerRules RuleSet SellGoodsPlannerRules)]


[METH Planner  SetGoal NIL
      NIL (method SetGoalPlanner RuleSet SetGoalPlanner)]


[METH Planner  SitTight NIL
      NIL (method SitTightPlanner RuleSet SitTightPlanner)]


[METH Planner  TakeTurn NIL
      NIL (method TakeTurnPlannerRules RuleSet TakeTurnPlannerRules)]


(DEFINEQ

(AtCurrentStopPlanner
  [LAMBDA (self)
    (PROG (↑auditRecord ↑value realLocation numBuy)
          [SETQ ↑value (SETQ realLocation (GetValue (GetValue self (QUOTE truck))
						    (QUOTE location]
          [COND
	    ([AND (GetValue self (QUOTE stoppingPlace))
		  (NEQ realLocation (GetValue self (QUOTE stoppingPlace]
	      (SETQ ↑value (WriteGameStatus "Oh! " (GetValue self (QUOTE driver))
					    " didnt reach stoppingPlace"]
          [COND
	    ((ISA realLocation ($ GasStation))
	      (SETQ ↑value (← self PurchaseGas]
          [COND
	    ((EQ realLocation (GetValue self (QUOTE destination)))
	      (SETQ ↑value (PROGN (PROGN                     (* Make an audit record for this rule and set its audit 
							     values.)
					 (SETQ ↑auditRecord (← ($ StandardAuditRecord)
							       NewTemp))
					 (PutValue ↑auditRecord (QUOTE rule)
						   (GetObjFromUID "LZS.0.5349.129.33698.191")))
				  (← self CarryOutGoal)
				  (PutAuditRec self (QUOTE destination)
					       NIL ↑auditRecord]
      QUIT(RETURN ↑value])

(BuyGasPlanner
  [LAMBDA (self)
    (PROG (↑value tdest)
          [COND
	    [[SETQ tdest (PickHiObj self (QUOTE RateGasStations)
				    (RoadStops ($ GasStation)
					       (← self Range]
	      (SETQ ↑value (PROGN (PutValue self (QUOTE destination)
					    tdest)
				  (PutValue self (QUOTE direction)
					    (DirectionOf (GetValue self (QUOTE destination]
	    [(OR (GREATERP (GetValue (GetValue self (QUOTE truck))
				     (QUOTE cashBox))
			   400000)
		 (LESSP (GetValue Simulator (QUOTE timeLeft))
			240))
	      (SETQ ↑value (PROGN (PutValue self (QUOTE destination)
					    (GetValue (GetValue self (QUOTE truck))
						      (QUOTE location)))
				  (PutValue self (QUOTE direction)
					    (DirectionOf (GetValue self (QUOTE destination]
	    (T (SETQ ↑value (PROGN (PutValue self (QUOTE destination)
					     (AnyRoadStop ($ UnionHall)))
				   (PutValue self (QUOTE direction)
					     (DirectionOf (GetValue self (QUOTE destination]
      QUIT(RETURN ↑value])

(BuyPlanner
  [LAMBDA (self)
    (PROG (↑value tdest)
          [COND
	    ([AND (PutValue self (QUOTE sellers)
			    (Sellers ($ Commodity)))
		  (SETQ tdest (PickHiObj self (QUOTE RateProducers)
					 (GetValue self (QUOTE sellers]
	      (SETQ ↑value (PROGN (PutValue self (QUOTE destination)
					    tdest)
				  (PutValue self (QUOTE direction)
					    (DirectionOf (GetValue self (QUOTE destination]
      QUIT(RETURN ↑value])

(CarryOutGoalPlanner
  [LAMBDA (self)
    (PROG (↑value numBuy)
          [COND
	    ((FMEMB (GetValue self (QUOTE goal))
		    (QUOTE (LeaveAlice SitTight GetClose GoToAlice)))
	      (SETQ ↑value (PROGN)))
	    ((EQ (GetValue self (QUOTE goal))
		 (QUOTE BuyGas))
	      (SETQ ↑value (PutValue self (QUOTE goal)
				     NIL)))
	    ((AND (EQ (GetValue self (QUOTE goal))
		      (QUOTE Buy))
		  [SETQ numBuy (← self MaxPurchase (GetValue (GetValue self (QUOTE truck))
							     (QUOTE location]
		  (GEQ numBuy 1))
	      (SETQ ↑value (← PlayerInterface Buy self numBuy)))
	    ((AND (EQ (GetValue self (QUOTE goal))
		      (QUOTE Sell))
		  (GetValue (GetValue self (QUOTE truck))
			    (QUOTE cargo)))
	      (SETQ ↑value (← self SellGoods]
      QUIT(RETURN ↑value])

(FindStoppingPlacePlannerRules
  [LAMBDA (self)
    (PROG (↑auditRecord ↑value wStation gasStation)
          [COND
	    [(EQ (GetValue (GetValue self (QUOTE truck))
			   (QUOTE fuel))
		 0)
	      (SETQ ↑value (PROGN (PROGN                     (* Make an audit record for this rule and set its audit 
							     values.)
					 (SETQ ↑auditRecord (← ($ StandardAuditRecord)
							       NewTemp))
					 (PutValue ↑auditRecord (QUOTE rule)
						   (GetObjFromUID "LYS.0.5349.124.36446.184")))
				  (PutAuditRec self (QUOTE stoppingPlace)
					       (AnyRoadStop ($ UnionHall))
					       ↑auditRecord]
	    [[AND [SETQ wStation (NearestRoadStop (RoadStops ($ WeighStation)
							     (← self Range1)
							     (GetValue self (QUOTE direction))
							     (QUOTE Room]
		  (LESSP (Distance wStation)
			 (Distance (GetValue self (QUOTE destination]
	      (SETQ ↑value (PROGN (PROGN                     (* Make an audit record for this rule and set its audit 
							     values.)
					 (SETQ ↑auditRecord (← ($ StandardAuditRecord)
							       NewTemp))
					 (PutValue ↑auditRecord (QUOTE rule)
						   (GetObjFromUID "LYS.0.5349.124.36446.185")))
				  (PutAuditRec self (QUOTE stoppingPlace)
					       wStation ↑auditRecord]
	    [[AND (LEQ (Distance (GetValue self (QUOTE destination)))
		       (← self Range1))
		  (RoomToParkP (GetValue self (QUOTE destination]
	      (SETQ ↑value (PROGN (PROGN                     (* Make an audit record for this rule and set its audit 
							     values.)
					 (SETQ ↑auditRecord (← ($ StandardAuditRecord)
							       NewTemp))
					 (PutValue ↑auditRecord (QUOTE rule)
						   (GetObjFromUID "LYS.0.5349.124.36446.186")))
				  (PutAuditRec self (QUOTE stoppingPlace)
					       (GetValue self (QUOTE destination))
					       ↑auditRecord]
	    [(AND [SETQ gasStation (FurthestRoadStop (RoadStops ($ GasStation)
								(← self Range1)
								(GetValue self (QUOTE direction))
								(QUOTE Room]
		  (GREATERP (GetValue gasStation (QUOTE qty))
			    0))
	      (SETQ ↑value (PROGN (PROGN                     (* Make an audit record for this rule and set its audit 
							     values.)
					 (SETQ ↑auditRecord (← ($ StandardAuditRecord)
							       NewTemp))
					 (PutValue ↑auditRecord (QUOTE rule)
						   (GetObjFromUID "LYS.0.5349.124.36446.187")))
				  (PutAuditRec self (QUOTE stoppingPlace)
					       gasStation ↑auditRecord]
	    (T (SETQ ↑value (PROGN (PROGN                    (* Make an audit record for this rule and set its audit 
							     values.)
					  (SETQ ↑auditRecord (← ($ StandardAuditRecord)
								NewTemp))
					  (PutValue ↑auditRecord (QUOTE rule)
						    (GetObjFromUID "LYS.0.5349.124.36446.188")))
				   (PutAuditRec self (QUOTE stoppingPlace)
						(NthRoadStop (GetValue self (QUOTE maxMove))
							     (GetValue self (QUOTE direction))
							     NIL
							     (QUOTE Room))
						↑auditRecord]
      QUIT(RETURN ↑value])

(GetClosePlanner
  [LAMBDA (self)
    (PROG (↑value)
          [COND
	    (T (SETQ ↑value (PROGN [PutValue self (QUOTE alices)
					     (NearestRoadStop (RoadStops ($ AlicesRestaurant]
				   (PutValue self (QUOTE destination)
					     (PickHiObj self (QUOTE RateSpotsNearAlices)
							(RoadStops)))
				   (PutValue self (QUOTE direction)
					     (DirectionOf (GetValue self (QUOTE destination]
      QUIT(RETURN ↑value])

(GoToAlicePlanner
  [LAMBDA (self)
    (PROG (↑value tdest)
          [COND
	    ((SETQ tdest (NearestRoadStop (RoadStops ($ AlicesRestaurant)
						     NIL NIL T)))
	      (SETQ ↑value (PROGN (PutValue self (QUOTE destination)
					    tdest)
				  (PutValue self (QUOTE direction)
					    (DirectionOf (GetValue self (QUOTE destination]
      QUIT(RETURN ↑value])

(GoToStoppingPlacePlannerRules
  [LAMBDA (self)
    (PROG (↑auditRecord ↑value)
          [COND
	    ((EQ (GetValue self (QUOTE stoppingPlace))
		 (GetValue (GetValue self (QUOTE truck))
			   (QUOTE location)))
	      (SETQ ↑value (WriteGameStatus "Hm! " (GetValue self (QUOTE driver))
					    " already there")))
	    ((← (GetValue self (QUOTE stoppingPlace))
		BanditP)
	      (SETQ ↑value (WriteGameStatus (GetValue self (QUOTE driver))
					    " Not moving because of bandits")))
	    (T (SETQ ↑value (← PlayerInterface Move self (GetValue self (QUOTE stoppingPlace]
      QUIT(RETURN ↑value])

(LeaveAlicePlanner
  [LAMBDA (self)
    (PROG (↑value)
          [COND
	    (T (SETQ ↑value (PROGN (PutValue self (QUOTE destination)
					     (NearestRoadStop (RoadStops ($ RoadStop)
									 NIL NIL T)))
				   (PutValue self (QUOTE direction)
					     (DirectionOf (GetValue self (QUOTE destination]
      QUIT(RETURN ↑value])

(PurchaseGasPlanner
  [LAMBDA (self)
    (PROG (↑value spaceInTank fuelAffordable fuelAvailable qty)
          [SETQ ↑value (PROGN [SETQ spaceInTank (DIFFERENCE (GetClassValue (GetValue self
										     (QUOTE truck))
									   (QUOTE MaxFuel))
							    (GetValue (GetValue self (QUOTE truck))
								      (QUOTE fuel]
			      (SETQ fuelAvailable (GetValue (GetValue (GetValue self (QUOTE truck))
								      (QUOTE location))
							    (QUOTE qty)))
			      [SETQ fuelAffordable (QUOTIENT (GetValue (GetValue self (QUOTE truck))
								       (QUOTE cashBox))
							     (PricePerUnit
							       (GetValue (GetValue self (QUOTE truck))
									 (QUOTE location]
			      (SETQ qty (MIN spaceInTank fuelAffordable fuelAvailable]
          [COND
	    ((GREATERP qty 0)
	      (SETQ ↑value (← PlayerInterface Buy self qty]
      QUIT(RETURN ↑value])

(RateDumpsPlanner
  [LAMBDA (self roadStop)
    (PROG (↑auditRecord ↑value rating cargo)
          (SETQ ↑value (PROGN [SETQ cargo (CAR (GetValue (GetValue self (QUOTE truck))
							 (QUOTE cargo]
			      (SETQ rating 0)))
          [COND
	    ((NOT (RoomToParkP roadStop))
	      (SETQ ↑value (SETQ rating (DIFFERENCE rating 500]
          [COND
	    ((LESSP (GetValue roadStop (QUOTE qty))
		    1)
	      (SETQ ↑value (SETQ rating (DIFFERENCE rating 1000]
          [SETQ ↑value (SETQ rating (PLUS rating (TIMES 100 (GetValue roadStop (QUOTE pr]
          [SETQ ↑value (SETQ rating (DIFFERENCE rating (TIMES (GetClassValue (GetValue self
										       (QUOTE truck))
									     (QUOTE Gpm))
							      (Distance roadStop
									(GetValue
									  (GetValue self
										    (QUOTE truck))
									  (QUOTE location]
      QUIT(RETURN ↑value])

(RateGasStationsPlannerRules
  [LAMBDA (self rs)
    (PROG (↑auditRecord ↑value rating)
          (SETQ ↑value (SETQ rating 0))
          [COND
	    ((EQ (GetValue rs (QUOTE qty))
		 0)
	      (SETQ ↑value (SETQ rating (MINUS 2000]
          [COND
	    ((NOT (RoomToParkP rs))
	      (SETQ ↑value (SETQ rating (DIFFERENCE rating 200]
      QUIT(RETURN ↑value])

(SellGoodsPlannerRules
  [LAMBDA (self)
    (PROG (↑auditRecord ↑value cargo sellQty)
          [SETQ ↑value (SETQ cargo (CAR (GetValue (GetValue self (QUOTE truck))
						  (QUOTE cargo]
          [COND
	    ([NOT (ISA cargo (GetClassValue (GetValue (GetValue self (QUOTE truck))
						      (QUOTE location))
					    (QUOTE Commodity]
	      (SETQ ↑value (PROGN                            (* ↑value set by RuleSetStop)
				  (RuleSetStop NIL (QUOTE NoSale)
					       (QUOTE WrongKindOfBuyer))
				  (GO QUIT]
          [COND
	    ((AND (NOT (GetValue cargo (QUOTE status)))
		  (ISA (GetValue (GetValue self (QUOTE truck))
				 (QUOTE location))
		       ($ CityDump)))
	      (SETQ ↑value (PROGN [SETQ sellQty (MIN (GetValue (GetValue (GetValue self (QUOTE truck))
									 (QUOTE location))
							       (QUOTE qty))
						     (GetValue cargo (QUOTE qty]
				  (← PlayerInterface Sell self cargo sellQty)
				  (PROGN                     (* ↑value set by RuleSetStop)
					 (RuleSetStop T (QUOTE Sold)
						      (QUOTE AtCityDump))
					 (GO QUIT]
          [COND
	    ((AND (LESSP (GetValue (GetValue (GetValue self (QUOTE truck))
					     (QUOTE location))
				   (QUOTE pr))
			 1.1)
		  (EQ (GetValue self (QUOTE goal))
		      (QUOTE Sell)))
	      (SETQ ↑value (PROGN                            (* ↑value set by RuleSetStop)
				  (RuleSetStop NIL (QUOTE NoSale)
					       (QUOTE AvoidCheapSkates))
				  (GO QUIT]
          [COND
	    ((LESSP (GetValue (GetValue (GetValue self (QUOTE truck))
					(QUOTE location))
			      (QUOTE pr))
		    0)
	      (SETQ ↑value (PROGN                            (* ↑value set by RuleSetStop)
				  (RuleSetStop NIL (QUOTE NoSale)
					       (QUOTE NeverAtLoss))
				  (GO QUIT]
          [COND
	    ((AND (GetValue cargo (QUOTE status))
		  [SETQ sellQty (MIN (GetValue (GetValue (GetValue self (QUOTE truck))
							 (QUOTE location))
					       (QUOTE qty))
				     (GetValue cargo (QUOTE qty]
		  (GEQ sellQty 1))
	      (SETQ ↑value (← PlayerInterface Sell self cargo sellQty]
      QUIT(RETURN ↑value])

(SellPlanner
  [LAMBDA (self)
    (PROG (↑value tdest has)
          [COND
	    [[AND [SETQ has (CAR (GetValue (GetValue self (QUOTE truck))
					   (QUOTE cargo]
		  (NOT (GetValue has (QUOTE status)))
		  (SETQ tdest (PickHiObj self (QUOTE RateDumps)
					 (RoadStops ($ CityDump]
	      (SETQ ↑value (PROGN (PutValue self (QUOTE destination)
					    tdest)
				  (PutValue self (QUOTE direction)
					    (DirectionOf (GetValue self (QUOTE destination]
	    ([AND has (SETQ tdest (PickHiObj self (QUOTE RateConsumers)
					     (Buyers has]
	      (SETQ ↑value (PROGN (PutValue self (QUOTE destination)
					    tdest)
				  (PutValue self (QUOTE direction)
					    (DirectionOf (GetValue self (QUOTE destination]
      QUIT(RETURN ↑value])

(SetGoalPlanner
  [LAMBDA (self)
    (PROG (↑value)
          [COND
	    [(AND (ISA (GetValue (GetValue self (QUOTE truck))
				 (QUOTE location))
		       ($ AlicesRestaurant))
		  (GEQ (← self TimeAtStop)
		       25))
	      (SETQ ↑value (PutValue self (QUOTE goal)
				     (QUOTE LeaveAlice]
	    ((FMEMB (GetValue self (QUOTE goal))
		    (QUOTE (SitTight BuyGas)))
	      (SETQ ↑value (PROGN)))
	    [(AND (EQ (GetValue self (QUOTE goal))
		      (QUOTE GoToAlice))
		  (ISA (GetValue (GetValue self (QUOTE truck))
				 (QUOTE location))
		       ($ AlicesRestaurant)))
	      (SETQ ↑value (PutValue self (QUOTE goal)
				     (QUOTE SitTight]
	    [(LESSP (GetValue Simulator (QUOTE timeLeft))
		    30)
	      (SETQ ↑value (PROGN (PutValue self (QUOTE goal)
					    (QUOTE GoToAlice))
				  (PutValue self (QUOTE higherGoal)
					    (QUOTE GoToAlice]
	    [(AND [LESSP (GetValue (GetValue self (QUOTE truck))
				   (QUOTE fuel))
			 (TIMES .25 (GetClassValue (GetValue self (QUOTE truck))
						   (QUOTE MaxFuel]
		  (GREATERP (GetValue (GetValue self (QUOTE truck))
				      (QUOTE cashBox))
			    0))
	      (SETQ ↑value (PROGN (PutValue self (QUOTE higherGoal)
					    (GetValue self (QUOTE goal)))
				  (PutValue self (QUOTE goal)
					    (QUOTE BuyGas]
	    [(LESSP (GetValue Simulator (QUOTE timeLeft))
		    60)
	      (SETQ ↑value (PROGN (PutValue self (QUOTE goal)
					    (QUOTE GetClose))
				  (PutValue self (QUOTE higherGoal)
					    (QUOTE GoToAlice]
	    [(GetValue (GetValue self (QUOTE truck))
		       (QUOTE cargo))
	      (SETQ ↑value (PutValue self (QUOTE goal)
				     (QUOTE Sell]
	    (T (SETQ ↑value (PutValue self (QUOTE goal)
				      (QUOTE Buy]
      QUIT(RETURN ↑value])

(SitTightPlanner
  [LAMBDA (self)
    (PROG (↑value)
          [COND
	    (T (SETQ ↑value (PutValue self (QUOTE destination)
				      NIL]
      QUIT(RETURN ↑value])

(TakeTurnPlannerRules
  [LAMBDA (self)
    (PROG (↑auditRecord ↑value possibleStops)
          (SETQ ↑value (← self SetGoal))
          [COND
	    ((GetValue self (QUOTE goal))
	      (SETQ ↑value (DoMethod self (GetValue self (QUOTE goal))
				     NIL]
          [COND
	    ((GetValue self (QUOTE destination))
	      (SETQ ↑value (← self FindStoppingPlace]
          [COND
	    ((AND (GetValue self (QUOTE destination))
		  (GetValue self (QUOTE stoppingPlace)))
	      (SETQ ↑value (PROGN (← self GoToStoppingPlace)
				  (← self AtCurrentStop]
      QUIT(RETURN ↑value])
)
[DEFINST RuleSet (AtCurrentStopPlanner "UVSC@EN@")
         (perspectiveNode #&(RuleSetNode "UVSC@ENF") myViewName RuleSet)
	 (name #(AtCurrentStopPlanner NIL RememberName))
	 (compiledRules AtCurrentStopPlanner)
	 (workSpace Planner)
	 (args NIL)
	 (tempVars (realLocation numBuy))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 4)
	 (controlStructure DOALL)
	 (whileCondition NIL)
	 (compilerOptions (A))
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass)]


[DEFINST RuleSet (BuyGasPlanner "UVSC@ELu")
         (perspectiveNode #&(RuleSetNode "UVSC@EM>"))
	 (name #(BuyGasPlanner NIL RememberName))
	 (compiledRules BuyGasPlanner)
	 (workSpace Planner)
	 (args NIL)
	 (tempVars (tdest))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 3)
	 (controlStructure DO1)
	 (whileCondition NIL)
	 (compilerOptions NIL)
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass)]


[DEFINST RuleSet (BuyPlanner "UVSC@ELv")
         (perspectiveNode #&(RuleSetNode "UVSC@EM?"))
	 (name #(BuyPlanner NIL RememberName))
	 (compiledRules BuyPlanner)
	 (workSpace Planner)
	 (args NIL)
	 (tempVars (tdest))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 1)
	 (controlStructure DO1)
	 (whileCondition NIL)
	 (compilerOptions NIL)
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass)]


[DEFINST RuleSet (CarryOutGoalPlanner "UVSC@ENA")
         (perspectiveNode #&(RuleSetNode "UVSC@ENG"))
	 (name #(CarryOutGoalPlanner NIL RememberName))
	 (compiledRules CarryOutGoalPlanner)
	 (workSpace Planner)
	 (args NIL)
	 (tempVars (numBuy))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 4)
	 (controlStructure DO1)
	 (whileCondition NIL)
	 (compilerOptions NIL)
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass)]


[DEFINST RuleSet (FindStoppingPlacePlannerRules "UVSC@EMq")
         (perspectiveNode #&(RuleSetNode "UVSC@ENH") myViewName RuleSet)
	 (name #(FindStoppingPlacePlannerRules NIL RememberName))
	 (compiledRules FindStoppingPlacePlannerRules)
	 (workSpace Planner)
	 (args NIL)
	 (tempVars (wStation gasStation))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 5)
	 (controlStructure DO1)
	 (whileCondition NIL)
	 (compilerOptions (A))
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass)]


[DEFINST RuleSet (GetClosePlanner "UVSC@ELr")
         (perspectiveNode #&(RuleSetNode "UVSC@EM@"))
	 (name #(GetClosePlanner NIL RememberName))
	 (compiledRules GetClosePlanner)
	 (workSpace Planner)
	 (args NIL)
	 (tempVars NIL)
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 1)
	 (controlStructure DO1)
	 (whileCondition NIL)
	 (compilerOptions NIL)
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass)]


[DEFINST RuleSet (GoToAlicePlanner "UVSC@ELs")
         (perspectiveNode #&(RuleSetNode "UVSC@EMA"))
	 (name #(GoToAlicePlanner NIL RememberName))
	 (compiledRules GoToAlicePlanner)
	 (workSpace Planner)
	 (args NIL)
	 (tempVars (tdest))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 1)
	 (controlStructure DO1)
	 (whileCondition NIL)
	 (compilerOptions NIL)
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass)]


[DEFINST RuleSet (GoToStoppingPlacePlannerRules "UVSC@EN=")
         (perspectiveNode #&(RuleSetNode "UVSC@ENI") myViewName RuleSet)
	 (name #(GoToStoppingPlacePlannerRules NIL RememberName))
	 (compiledRules GoToStoppingPlacePlannerRules)
	 (workSpace Planner)
	 (args NIL)
	 (tempVars NIL)
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 3)
	 (controlStructure DO1)
	 (whileCondition NIL)
	 (compilerOptions (A))
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass)]


[DEFINST RuleSet (LeaveAlicePlanner "UVSC@ELq")
         (perspectiveNode #&(RuleSetNode "UVSC@EMB"))
	 (name #(LeaveAlicePlanner NIL RememberName))
	 (compiledRules LeaveAlicePlanner)
	 (workSpace Planner)
	 (args NIL)
	 (tempVars NIL)
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 1)
	 (controlStructure DO1)
	 (whileCondition NIL)
	 (compilerOptions NIL)
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass)]


[DEFINST RuleSet (PurchaseGasPlanner "UVSC@ENx")
         (perspectiveNode #&(RuleSetNode "UVSC@EO?") myViewName RuleSet)
	 (name #(PurchaseGasPlanner NIL RememberName))
	 (compiledRules PurchaseGasPlanner)
	 (workSpace Planner)
	 (args NIL)
	 (tempVars (spaceInTank fuelAffordable fuelAvailable qty))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 2)
	 (controlStructure DOALL)
	 (whileCondition NIL)
	 (compilerOptions NIL)
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass)]


[DEFINST RuleSet (RateDumpsPlanner "UVSC@EL|")
         (perspectiveNode #&(RuleSetNode "UVSC@EMC") myViewName RuleSet)
	 (name #(RateDumpsPlanner NIL RememberName))
	 (compiledRules RateDumpsPlanner)
	 (workSpace Planner)
	 (args (roadStop))
	 (tempVars (rating cargo))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 5)
	 (controlStructure DOALL)
	 (whileCondition NIL)
	 (compilerOptions (A))
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass)]


[DEFINST RuleSet (RateGasStationsPlannerRules "UVSC@ENC")
         (perspectiveNode #&(RuleSetNode "UVSC@ENJ") myViewName RuleSet)
	 (name #(RateGasStationsPlannerRules NIL RememberName))
	 (compiledRules RateGasStationsPlannerRules)
	 (workSpace Planner)
	 (args (rs))
	 (tempVars (rating))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 3)
	 (controlStructure DOALL)
	 (whileCondition NIL)
	 (compilerOptions (A))
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass)]


[DEFINST RuleSet (SellGoodsPlannerRules "LZS.0.5349.129.33698.187")
         (perspectiveNode #&(RuleSetNode "LZS.0.5349.129.33698.210") myViewName RuleSet)
	 (name #(SellGoodsPlannerRules NIL RememberName))
	 (compiledRules SellGoodsPlannerRules)
	 (workSpace Planner)
	 (args NIL)
	 (tempVars (cargo sellQty))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 6)
	 (controlStructure DOALL)
	 (whileCondition NIL)
	 (compilerOptions (A))
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass)]


[DEFINST RuleSet (SellPlanner "UVSC@ELx")
         (perspectiveNode #&(RuleSetNode "UVSC@EMD"))
	 (name #(SellPlanner NIL RememberName))
	 (compiledRules SellPlanner)
	 (workSpace Planner)
	 (args NIL)
	 (tempVars (tdest has))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 2)
	 (controlStructure DO1)
	 (whileCondition NIL)
	 (compilerOptions NIL)
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass)]


[DEFINST RuleSet (SetGoalPlanner "UVSC@ELo")
         (perspectiveNode #&(RuleSetNode "UVSC@EME") myViewName RuleSet)
	 (name #(SetGoalPlanner NIL RememberName))
	 (compiledRules SetGoalPlanner)
	 (workSpace Planner)
	 (args NIL)
	 (tempVars NIL)
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 8)
	 (controlStructure DO1)
	 (whileCondition NIL)
	 (compilerOptions NIL)
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass)]


[DEFINST RuleSet (SitTightPlanner "UVSC@ELp")
         (perspectiveNode #&(RuleSetNode "UVSC@EMF"))
	 (name #(SitTightPlanner NIL RememberName))
	 (compiledRules SitTightPlanner)
	 (workSpace Planner)
	 (args NIL)
	 (tempVars NIL)
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 1)
	 (controlStructure DO1)
	 (whileCondition NIL)
	 (compilerOptions NIL)
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass)]


[DEFINST RuleSet (TakeTurnPlannerRules "UVSC@ELg")
         (perspectiveNode #&(RuleSetNode "UVSC@EMG") myViewName RuleSet)
	 (name #(TakeTurnPlannerRules NIL RememberName))
	 (compiledRules TakeTurnPlannerRules)
	 (workSpace Planner)
	 (args NIL)
	 (tempVars (possibleStops))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 4)
	 (controlStructure DOALL)
	 (whileCondition NIL)
	 (compilerOptions (A))
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass)]


[DEFINST RuleSetNode ("UVSC@ENF")
         (perspectives ? RuleSet #&(RuleSet "UVSC@EN@") Source #&(RuleSetSource "UVSC@ENK"))]


[DEFINST RuleSetNode ("UVSC@EM>")
         (perspectives ? RuleSet #&(RuleSet "UVSC@ELu") Source #&(RuleSetSource "UVSC@EMH"))]


[DEFINST RuleSetNode ("UVSC@EM?")
         (perspectives ? RuleSet #&(RuleSet "UVSC@ELv") Source #&(RuleSetSource "UVSC@EMI"))]


[DEFINST RuleSetNode ("UVSC@ENG")
         (perspectives ? RuleSet #&(RuleSet "UVSC@ENA") Source #&(RuleSetSource "UVSC@ENL"))]


[DEFINST RuleSetNode ("UVSC@ENH")
         (perspectives ? RuleSet #&(RuleSet "UVSC@EMq") Source #&(RuleSetSource "UVSC@ENM"))]


[DEFINST RuleSetNode ("UVSC@EM@")
         (perspectives ? RuleSet #&(RuleSet "UVSC@ELr") Source #&(RuleSetSource "UVSC@EMJ"))]


[DEFINST RuleSetNode ("UVSC@EMA")
         (perspectives ? RuleSet #&(RuleSet "UVSC@ELs") Source #&(RuleSetSource "UVSC@EMK"))]


[DEFINST RuleSetNode ("UVSC@ENI")
         (perspectives ? RuleSet #&(RuleSet "UVSC@EN=") Source #&(RuleSetSource "UVSC@ENN"))]


[DEFINST RuleSetNode ("UVSC@EMB")
         (perspectives ? RuleSet #&(RuleSet "UVSC@ELq") Source #&(RuleSetSource "UVSC@EML"))]


[DEFINST RuleSetNode ("UVSC@EO?")
         (perspectives ? RuleSet #&(RuleSet "UVSC@ENx") Source #&(RuleSetSource "UVSC@EO@"))]


[DEFINST RuleSetNode ("UVSC@EMC")
         (perspectives ? RuleSet #&(RuleSet "UVSC@EL|") Source #&(RuleSetSource "UVSC@EMM"))]


[DEFINST RuleSetNode ("UVSC@ENJ")
         (perspectives ? RuleSet #&(RuleSet "UVSC@ENC") Source #&(RuleSetSource "UVSC@ENO"))]


[DEFINST RuleSetNode ("LZS.0.5349.129.33698.210")
         (perspectives ? RuleSet #&(RuleSet "LZS.0.5349.129.33698.187") Source 
		       #&(RuleSetSource "LZS.0.5349.129.33698.211"))]


[DEFINST RuleSetNode ("UVSC@EMD")
         (perspectives ? RuleSet #&(RuleSet "UVSC@ELx") Source #&(RuleSetSource "UVSC@EMN"))]


[DEFINST RuleSetNode ("UVSC@EME")
         (perspectives ? RuleSet #&(RuleSet "UVSC@ELo") Source #&(RuleSetSource "UVSC@EMO"))]


[DEFINST RuleSetNode ("UVSC@EMF")
         (perspectives ? RuleSet #&(RuleSet "UVSC@ELp") Source #&(RuleSetSource "UVSC@EMP"))]


[DEFINST RuleSetNode ("UVSC@EMG")
         (perspectives ? RuleSet #&(RuleSet "UVSC@ELg") Source #&(RuleSetSource "UVSC@EMQ"))]


[DEFINST RuleSetSource ("UVSC@ENK")
         (indexedVars ((#&(Rule "LZS.0.5349.129.33698.212"))
		       (#&(Rule "LZS.0.5349.129.33698.213"))
		       (#&(Rule "LZS.0.5349.129.33698.214"))
		       (#&(Rule "LZS.0.5349.129.33698.191"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@ENF") myViewName Source)
	 (created " 1-FEB-83 14:25:34")
	 (creator LOOPSCOURSE)
	 (edited "26-JUL-83 16:22:13")
	 (editor MITTAL)]


[DEFINST RuleSetSource ("UVSC@EMH")
         (indexedVars ((#&(Rule "SAS.0.5349.120.55117.1"))
		       (#&(Rule "SAS.0.5349.120.55117.2"))
		       (#&(Rule "SAS.0.5349.120.55117.3"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@EM>"))
	 (created "22-JUN-83 17:07:59")
	 (creator MITTAL)
	 (edited " 1-SEP-83 16:13:34")
	 (editor MITTAL)]


[DEFINST RuleSetSource ("UVSC@EMI")
         (indexedVars ((#&(Rule "LZS.0.5349.129.33698.155"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@EM?"))
	 (created "22-JUN-83 17:15:22")
	 (creator MITTAL)
	 (edited "26-JUL-83 12:39:19")
	 (editor MITTAL)]


[DEFINST RuleSetSource ("UVSC@ENL")
         (indexedVars ((#&(Rule "LYS.0.5349.124.36446.197"))
		       (#&(Rule "LYS.0.5349.124.36446.198"))
		       (#&(Rule "LYS.0.5349.124.36446.199"))
		       (#&(Rule "LYS.0.5349.124.36446.200"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@ENG"))
	 (created "23-JUN-83 10:16:54")
	 (creator MITTAL)
	 (edited "25-JUL-83 10:20:15")
	 (editor STEFIK)]


[DEFINST RuleSetSource ("UVSC@ENM")
         (indexedVars ((#&(Rule "LZS.0.5349.129.33698.156"))
		       (#&(Rule "LZS.0.5349.129.33698.157"))
		       (#&(Rule "LZS.0.5349.129.33698.158"))
		       (#&(Rule "LZS.0.5349.129.33698.159"))
		       (#&(Rule "LZS.0.5349.129.33698.160"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@ENH") myViewName Source)
	 (created " 1-FEB-83 14:25:23")
	 (creator LOOPSCOURSE)
	 (edited "26-JUL-83 13:27:18")
	 (editor MITTAL)]


[DEFINST RuleSetSource ("UVSC@EMJ")
         (indexedVars ((#&(Rule "LZS.0.5349.129.33698.161"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@EM@"))
	 (created "22-JUN-83 16:47:34")
	 (creator MITTAL)
	 (edited "26-JUL-83 12:42:45")
	 (editor MITTAL)]


[DEFINST RuleSetSource ("UVSC@EMK")
         (indexedVars ((#&(Rule "LZS.0.5349.129.33698.162"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@EMA"))
	 (created "22-JUN-83 16:49:44")
	 (creator MITTAL)
	 (edited "26-JUL-83 12:43:07")
	 (editor MITTAL)]


[DEFINST RuleSetSource ("UVSC@ENN")
         (indexedVars ((#&(Rule "LZS.0.5349.129.33698.215"))
		       (#&(Rule "LZS.0.5349.129.33698.216"))
		       (#&(Rule "LZS.0.5349.129.33698.217"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@ENI") myViewName Source)
	 (created " 1-FEB-83 14:25:34")
	 (creator LOOPSCOURSE)
	 (edited "26-JUL-83 16:43:55")
	 (editor MITTAL)]


[DEFINST RuleSetSource ("UVSC@EML")
         (indexedVars ((#&(Rule "LYS.0.5349.124.36446.208"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@EMB"))
	 (created "22-JUN-83 16:41:38")
	 (creator MITTAL)
	 (edited "25-JUL-83 10:21:03")
	 (editor STEFIK)]


[DEFINST RuleSetSource ("UVSC@EO@")
         (indexedVars ((#&(Rule "LYS.0.5349.124.36446.209"))
		       (#&(Rule "LYS.0.5349.124.36446.210"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@EO?") myViewName Source)
	 (created "27-JAN-83 00:31:21")
	 (creator STEFIK)
	 (edited "25-JUL-83 10:21:12")
	 (editor STEFIK)]


[DEFINST RuleSetSource ("UVSC@EMM")
         (indexedVars ((#&(Rule "LYS.0.5349.124.36446.211"))
		       (#&(Rule "LYS.0.5349.124.36446.212"))
		       (#&(Rule "LYS.0.5349.124.36446.213"))
		       (#&(Rule "LYS.0.5349.124.36446.214"))
		       (#&(Rule "LYS.0.5349.124.36446.215"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@EMC") myViewName Source)
	 (created "18-FEB-83 22:45:14")
	 (creator STEFIK)
	 (edited "25-JUL-83 10:21:31")
	 (editor STEFIK)]


[DEFINST RuleSetSource ("UVSC@ENO")
         (indexedVars ((#&(Rule "LYS.0.5349.124.36446.216"))
		       (#&(Rule "LYS.0.5349.124.36446.217"))
		       (#&(Rule "LYS.0.5349.124.36446.218"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@ENJ") myViewName Source)
	 (created "19-MAY-83 17:26:44")
	 (creator MITTAL)
	 (edited "25-JUL-83 10:21:40")
	 (editor STEFIK)]


[DEFINST RuleSetSource ("LZS.0.5349.129.33698.211")
         (indexedVars ((#&(Rule "LZS.0.5349.129.33698.218"))
		       (#&(Rule "LZS.0.5349.129.33698.219"))
		       (#&(Rule "LZS.0.5349.129.33698.220"))
		       (#&(Rule "LZS.0.5349.129.33698.221"))
		       (#&(Rule "LZS.0.5349.129.33698.222"))
		       (#&(Rule "LZS.0.5349.129.33698.223"))))
	 (perspectiveNode #&(RuleSetNode "LZS.0.5349.129.33698.210") myViewName Source)
	 (created " 1-FEB-83 14:25:40")
	 (creator LOOPSCOURSE)
	 (edited "26-JUL-83 16:05:44")
	 (editor MITTAL)]


[DEFINST RuleSetSource ("UVSC@EMN")
         (indexedVars ((#&(Rule "LZS.0.5349.129.33698.163"))
		       (#&(Rule "LZS.0.5349.129.33698.164"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@EMD"))
	 (created "22-JUN-83 17:30:30")
	 (creator MITTAL)
	 (edited "26-JUL-83 12:48:04")
	 (editor MITTAL)]


[DEFINST RuleSetSource ("UVSC@EMO")
         (indexedVars ((#&(Rule "LZS.0.5349.129.33698.165"))
		       (#&(Rule "LZS.0.5349.129.33698.166"))
		       (#&(Rule "LZS.0.5349.129.33698.167"))
		       (#&(Rule "LZS.0.5349.129.33698.168"))
		       (#&(Rule "LZS.0.5349.129.33698.169"))
		       (#&(Rule "LZS.0.5349.129.33698.170"))
		       (#&(Rule "LZS.0.5349.129.33698.171"))
		       (#&(Rule "LZS.0.5349.129.33698.172"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@EME") myViewName Source)
	 (created "22-JUN-83 15:37:14")
	 (creator MITTAL)
	 (edited "26-JUL-83 14:07:39")
	 (editor MITTAL)]


[DEFINST RuleSetSource ("UVSC@EMP")
         (indexedVars ((#&(Rule "LYS.0.5349.124.36446.230"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@EMF"))
	 (created "22-JUN-83 16:39:26")
	 (creator MITTAL)
	 (edited "25-JUL-83 10:22:13")
	 (editor STEFIK)]


[DEFINST RuleSetSource ("UVSC@EMQ")
         (indexedVars ((#&(Rule "LZS.0.5349.129.33698.224"))
		       (#&(Rule "LZS.0.5349.129.33698.225"))
		       (#&(Rule "LZS.0.5349.129.33698.226"))
		       (#&(Rule "LZS.0.5349.129.33698.227"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@EMG") myViewName Source)
	 (created " 1-FEB-83 14:25:51")
	 (creator LOOPSCOURSE)
	 (edited "26-JUL-83 16:34:06")
	 (editor MITTAL)]


[DEFINST Rule ("LZS.0.5349.129.33698.212")
         (source "(* Take action at current stop)

-> realLocation←truck:location;")
	 (edited "26-JUL-83 16:22:13")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@EN@"))]


[DEFINST Rule ("LZS.0.5349.129.33698.213")
         (source 
"IF stoppingPlace realLocation~=stoppingPlace 
 THEN (WriteGameStatus %"Oh! %" driver %" didnt reach stoppingPlace%");")
	 (edited "26-JUL-83 16:22:13")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "UVSC@EN@"))]


[DEFINST Rule ("LZS.0.5349.129.33698.214")
         (source "IF (ISA realLocation $GasStation)
 THEN .PurchaseGas;")
	 (edited "26-JUL-83 16:22:13")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "UVSC@EN@"))]


[DEFINST Rule ("LZS.0.5349.129.33698.191")
         (source "IF realLocation=destination 
 THEN .CarryOutGoal  destination←NIL;")
	 (edited "26-JUL-83 16:22:13")
	 (editor MITTAL)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "UVSC@EN@"))]


[DEFINST Rule ("SAS.0.5349.120.55117.1")
         (source 
"IF tdest←(PickHiObj self 'RateGasStations (RoadStops $GasStation .Range))
 THEN destination←tdest  direction←(DirectionOf destination);")
	 (edited " 1-SEP-83 16:13:34")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@ELu"))]


[DEFINST Rule ("SAS.0.5349.120.55117.2")
         (source 
"IF (OR truck:cashBox > 400000 \Simulator:timeLeft < 240)
 THEN destination←truck:location direction←(DirectionOf destination);")
	 (edited " 1-SEP-83 16:13:34")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "UVSC@ELu"))]


[DEFINST Rule ("SAS.0.5349.120.55117.3")
         (source "THEN destination←(AnyRoadStop $UnionHall) direction←(DirectionOf destination);")
	 (edited " 1-SEP-83 16:13:34")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "UVSC@ELu"))]


[DEFINST Rule ("LZS.0.5349.129.33698.155")
         (source 
"IF sellers←(Sellers $Commodity)
  tdest←(PickHiObj self 'RateProducers sellers)
 THEN destination←tdest
        direction←(DirectionOf destination);")
	 (edited "26-JUL-83 12:39:19")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@ELv"))]


[DEFINST Rule ("LYS.0.5349.124.36446.197")
         (source 
"(* Carry out goal, revising them if needed)
IF goal << '(LeaveAlice SitTight GetClose GoToAlice) 
 THEN ;")
	 (edited "25-JUL-83 10:20:15")
	 (editor STEFIK)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@ENA"))]


[DEFINST Rule ("LYS.0.5349.124.36446.198")
         (source "IF goal='BuyGas THEN goal←NIL;")
	 (edited "25-JUL-83 10:20:15")
	 (editor STEFIK)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "UVSC@ENA"))]


[DEFINST Rule ("LYS.0.5349.124.36446.199")
         (source 
"IF goal='Buy numBuy←(← self MaxPurchase truck:location)
   numBuy>= 1
 THEN (← \PlayerInterface Buy self numBuy);")
	 (edited "25-JUL-83 10:20:15")
	 (editor STEFIK)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "UVSC@ENA"))]


[DEFINST Rule ("LYS.0.5349.124.36446.200")
         (source "IF goal='Sell truck:cargo
 THEN .SellGoods;")
	 (edited "25-JUL-83 10:20:15")
	 (editor STEFIK)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "UVSC@ENA"))]


[DEFINST Rule ("LZS.0.5349.129.33698.156")
         (source 
"(* Returns a stopping place en route to a destination.)

IF truck:fuel=0
THEN stoppingPlace←(AnyRoadStop $UnionHall);")
	 (edited "26-JUL-83 13:27:18")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@EMq"))]


[DEFINST Rule ("LZS.0.5349.129.33698.157")
         (source 
"(* Obey the law - stop at WeighStations.)
IF wStation←(NearestRoadStop (RoadStops $WeighStation .Range1 direction 'Room))
   (Distance wStation)<(Distance destination) 
THEN stoppingPlace←wStation;")
	 (edited "26-JUL-83 13:27:18")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "UVSC@EMq"))]


[DEFINST Rule ("LZS.0.5349.129.33698.158")
         (source 
   "IF (Distance destination)<=.Range1 (RoomToParkP destination)
THEN stoppingPlace←destination;")
	 (edited "26-JUL-83 13:27:18")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "UVSC@EMq"))]


[DEFINST Rule ("LZS.0.5349.129.33698.159")
         (source 
"IF gasStation←(FurthestRoadStop (RoadStops $GasStation .Range1 direction 'Room))
   gasStation:qty>0
THEN stoppingPlace←gasStation;")
	 (edited "26-JUL-83 13:27:18")
	 (editor MITTAL)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "UVSC@EMq"))]


[DEFINST Rule ("LZS.0.5349.129.33698.160")
         (source "THEN stoppingPlace←(NthRoadStop  maxMove direction NIL 'Room);")
	 (edited "26-JUL-83 13:27:18")
	 (editor MITTAL)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "UVSC@EMq"))]


[DEFINST Rule ("LZS.0.5349.129.33698.161")
         (source 
"-> alices←(NearestRoadStop(RoadStops $AlicesRestaurant ))
   destination←(PickHiObj self 'RateSpotsNearAlices (RoadStops))
   direction← (DirectionOf destination);")
	 (edited "26-JUL-83 12:42:45")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@ELr"))]


[DEFINST Rule ("LZS.0.5349.129.33698.162")
         (source 
"IF  tdest← (NearestRoadStop(RoadStops $AlicesRestaurant NIL NIL T))
 THEN   destination←tdest
          direction ← (DirectionOf destination);")
	 (edited "26-JUL-83 12:43:07")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@ELs"))]


[DEFINST Rule ("LZS.0.5349.129.33698.215")
         (source 
"(* Go to the stoppingPlace)
IF stoppingPlace=truck:location
 THEN (WriteGameStatus %"Hm! %" driver %" already there%");")
	 (edited "26-JUL-83 16:43:55")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@EN="))]


[DEFINST Rule ("LZS.0.5349.129.33698.216")
         (source 
   "IF stoppingPlace.BanditP
 THEN (WriteGameStatus  driver %" Not moving because of bandits%");")
	 (edited "26-JUL-83 16:43:55")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "UVSC@EN="))]


[DEFINST Rule ("LZS.0.5349.129.33698.217")
         (source "-> (← \PlayerInterface Move self stoppingPlace);")
	 (edited "26-JUL-83 16:43:55")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "UVSC@EN="))]


[DEFINST Rule ("LYS.0.5349.124.36446.208")
         (source 
"-> destination← (NearestRoadStop (RoadStops $RoadStop NIL NIL T))
   direction← (DirectionOf destination);")
	 (edited "25-JUL-83 10:21:03")
	 (editor STEFIK)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@ELq"))]


[DEFINST Rule ("LYS.0.5349.124.36446.209")
         (source 
"(* Buy gasoline as limited by various constraints.)

     THEN spaceInTank←truck::MaxFuel-truck:fuel
	
          fuelAvailable←truck:location:qty

          fuelAffordable←truck:cashBox/(PricePerUnit truck:location)

          qty←(MIN spaceInTank fuelAffordable fuelAvailable);")
	 (edited "25-JUL-83 10:21:12")
	 (editor STEFIK)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@ENx"))]


[DEFINST Rule ("LYS.0.5349.124.36446.210")
         (source 
"(* Now appropriate quantity has been computed)

    IF qty>0
     THEN  (← \PlayerInterface Buy self qty );")
	 (edited "25-JUL-83 10:21:12")
	 (editor STEFIK)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "UVSC@ENx"))]


[DEFINST Rule ("LYS.0.5349.124.36446.211")
         (source 
      "	(* Rate the suitability of a proposed Consumer.)

-> cargo ← (CAR truck:cargo) rating←0;")
	 (edited "25-JUL-83 10:21:31")
	 (editor STEFIK)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@EL|"))]


[DEFINST Rule ("LYS.0.5349.124.36446.212")
         (source 
	  "(* Need to be able to park)
 IF ~(RoomToParkP roadStop)
  THEN rating ← rating - 500;")
	 (edited "25-JUL-83 10:21:31")
	 (editor STEFIK)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "UVSC@EL|"))]


[DEFINST Rule ("LYS.0.5349.124.36446.213")
         (source 
"(* Exclude consumers that have full inventory.)
 IF roadStop:qty < 1
  THEN rating ← rating - 1000;")
	 (edited "25-JUL-83 10:21:31")
	 (editor STEFIK)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "UVSC@EL|"))]


[DEFINST Rule ("LYS.0.5349.124.36446.214")
         (source "(* Favor high price ratios.)
  -> rating ← rating + 100 * roadStop:pr ;")
	 (edited "25-JUL-83 10:21:31")
	 (editor STEFIK)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "UVSC@EL|"))]


[DEFINST Rule ("LYS.0.5349.124.36446.215")
         (source 
"(* Favor close places.)
  -> rating ← rating - [truck::Gpm *(Distance roadStop truck:location)];")
	 (edited "25-JUL-83 10:21:31")
	 (editor STEFIK)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "UVSC@EL|"))]


[DEFINST Rule ("LYS.0.5349.124.36446.216")
         (source "(* rate gas stations within range)
 THEN rating ← 0;")
	 (edited "25-JUL-83 10:21:40")
	 (editor STEFIK)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@ENC"))]


[DEFINST Rule ("LYS.0.5349.124.36446.217")
         (source "IF rs:qty=0 
 THEN rating ← -2000;")
	 (edited "25-JUL-83 10:21:40")
	 (editor STEFIK)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "UVSC@ENC"))]


[DEFINST Rule ("LYS.0.5349.124.36446.218")
         (source "IF ~(RoomToParkP rs)
 THEN rating ← rating - 200;")
	 (edited "25-JUL-83 10:21:40")
	 (editor STEFIK)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "UVSC@ENC"))]


[DEFINST Rule ("LZS.0.5349.129.33698.218")
         (source "	-> cargo←(CAR truck:cargo);")
	 (edited "26-JUL-83 16:05:44")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.187"))]


[DEFINST Rule ("LZS.0.5349.129.33698.219")
         (source 
	 "	IF ~(ISA cargo truck:location::Commodity)
	THEN (STOP NIL 'NoSale 'WrongKindOfBuyer);")
	 (edited "26-JUL-83 16:05:44")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.187"))]


[DEFINST Rule ("LZS.0.5349.129.33698.220")
         (source 
"	(* Make sale as limited by cargo and consumer.)

        IF ~cargo:status (ISA truck:location $CityDump)
         THEN sellQty←(MIN truck:location:qty cargo:qty) 
              (← \PlayerInterface Sell  self cargo sellQty)
              (STOP T 'Sold 'AtCityDump);")
	 (edited "26-JUL-83 16:05:44")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.187"))]


[DEFINST Rule ("LZS.0.5349.129.33698.221")
         (source 
	    "	IF truck:location:pr < 1.1 goal='Sell 
	THEN (STOP NIL 'NoSale 'AvoidCheapSkates);")
	 (edited "26-JUL-83 16:05:44")
	 (editor MITTAL)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.187"))]


[DEFINST Rule ("LZS.0.5349.129.33698.222")
         (source "        IF truck:location:pr < 0
        THEN (STOP NIL 'NoSale 'NeverAtLoss);")
	 (edited "26-JUL-83 16:05:44")
	 (editor MITTAL)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.187"))]


[DEFINST Rule ("LZS.0.5349.129.33698.223")
         (source 
"	IF cargo:status sellQty←(MIN truck:location:qty cargo:qty) sellQty>=1 
	THEN (← \PlayerInterface Sell self cargo sellQty);")
	 (edited "26-JUL-83 16:05:44")
	 (editor MITTAL)
	 (ruleNumber 6)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.187"))]


[DEFINST Rule ("LZS.0.5349.129.33698.163")
         (source 
"IF has←(CAR truck:cargo) ~has:status tdest←(PickHiObj self 'RateDumps (RoadStops $CityDump))
 THEN destination←tdest direction←(DirectionOf destination);")
	 (edited "26-JUL-83 12:48:04")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@ELx"))]


[DEFINST Rule ("LZS.0.5349.129.33698.164")
         (source 
"IF has tdest←(PickHiObj self 'RateConsumers (Buyers has))
 THEN destination←tdest  direction←(DirectionOf destination);")
	 (edited "26-JUL-83 12:48:04")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "UVSC@ELx"))]


[DEFINST Rule ("LZS.0.5349.129.33698.165")
         (source 
"(* Sets the goal)

IF (ISA truck:location $AlicesRestaurant) .TimeAtStop>=25
 THEN goal←'LeaveAlice;")
	 (edited "26-JUL-83 14:07:39")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@ELo"))]


[DEFINST Rule ("LZS.0.5349.129.33698.166")
         (source "IF goal << '(SitTight BuyGas) THEN ;")
	 (edited "26-JUL-83 14:07:39")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "UVSC@ELo"))]


[DEFINST Rule ("LZS.0.5349.129.33698.167")
         (source "IF goal='GoToAlice (ISA truck:location $AlicesRestaurant) 
 THEN goal←'SitTight;")
	 (edited "26-JUL-83 14:07:39")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "UVSC@ELo"))]


[DEFINST Rule ("LZS.0.5349.129.33698.168")
         (source "IF \Simulator:timeLeft <30
 THEN goal←'GoToAlice higherGoal←'GoToAlice;")
	 (edited "26-JUL-83 14:07:39")
	 (editor MITTAL)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "UVSC@ELo"))]


[DEFINST Rule ("LZS.0.5349.129.33698.169")
         (source 
    "IF truck:fuel < .25 * truck::MaxFuel  truck:cashBox > 0
 THEN higherGoal←goal goal←'BuyGas;")
	 (edited "26-JUL-83 14:07:39")
	 (editor MITTAL)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "UVSC@ELo"))]


[DEFINST Rule ("LZS.0.5349.129.33698.170")
         (source "IF \Simulator:timeLeft < 60 
 THEN goal←'GetClose higherGoal←'GoToAlice;")
	 (edited "26-JUL-83 14:07:39")
	 (editor MITTAL)
	 (ruleNumber 6)
	 (ruleSet #&(RuleSet "UVSC@ELo"))]


[DEFINST Rule ("LZS.0.5349.129.33698.171")
         (source "IF truck:cargo
 THEN goal←'Sell;")
	 (edited "26-JUL-83 14:07:39")
	 (editor MITTAL)
	 (ruleNumber 7)
	 (ruleSet #&(RuleSet "UVSC@ELo"))]


[DEFINST Rule ("LZS.0.5349.129.33698.172")
         (source "-> goal←'Buy;")
	 (edited "26-JUL-83 14:07:39")
	 (editor MITTAL)
	 (ruleNumber 8)
	 (ruleSet #&(RuleSet "UVSC@ELo"))]


[DEFINST Rule ("LYS.0.5349.124.36446.230")
         (source "-> destination←NIL;")
	 (edited "25-JUL-83 10:22:13")
	 (editor STEFIK)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@ELp"))]


[DEFINST Rule ("LZS.0.5349.129.33698.224")
         (source 
       "   (* Top-Level RuleSet for taking turns.  Sets goal and destination.)

 
 ->  .SetGoal;")
	 (edited "26-JUL-83 16:34:06")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@ELg"))]


[DEFINST Rule ("LZS.0.5349.129.33698.225")
         (source "IF goal THEN (←! self goal);")
	 (edited "26-JUL-83 16:34:06")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "UVSC@ELg"))]


[DEFINST Rule ("LZS.0.5349.129.33698.226")
         (source "IF destination THEN .FindStoppingPlace;")
	 (edited "26-JUL-83 16:34:06")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "UVSC@ELg"))]


[DEFINST Rule ("LZS.0.5349.129.33698.227")
         (source "IF destination stoppingPlace 
 THEN .GoToStoppingPlace
      .AtCurrentStop;")
	 (edited "26-JUL-83 16:34:06")
	 (editor MITTAL)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "UVSC@ELg"))]


(DECLARE: DONTCOPY
  (FILEMAP (NIL (4142 19620 (AtCurrentStopPlanner 4152 . 5207) (BuyGasPlanner 5209 . 6200) (BuyPlanner 
6202 . 6641) (CarryOutGoalPlanner 6643 . 7424) (FindStoppingPlacePlannerRules 7426 . 10416) (
GetClosePlanner 10418 . 10849) (GoToAlicePlanner 10851 . 11222) (GoToStoppingPlacePlannerRules 11224
 . 11828) (LeaveAlicePlanner 11830 . 12166) (PurchaseGasPlanner 12168 . 13039) (RateDumpsPlanner 13041
 . 13907) (RateGasStationsPlannerRules 13909 . 14273) (SellGoodsPlannerRules 14275 . 16365) (
SellPlanner 16367 . 17136) (SetGoalPlanner 17138 . 18865) (SitTightPlanner 18867 . 19037) (
TakeTurnPlannerRules 19039 . 19618)))))
STOP
P