(FILECREATED "23-JUN-83 14:10:20" {INDIGO}<LOOPS>TRUCKIN>PLAYERS>PLANNER.;4 61565  

      changes to:  (FNS GetClosePlanner SetGoalPlanner)

      previous date: "22-JUN-83 18:17:14" {INDIGO}<LOOPS>TRUCKIN>PLAYERS>PLANNER.;1)


(PRETTYCOMPRINT PLANNERCOMS)

(RPAQQ PLANNERCOMS ((INSTANCES AtCurrentStopPlanner BuyGasPlanner BuyPlanner CarryOutGoalPlanner 
			       FindStoppingPlacePlannerRules GetClosePlanner GoToAlicePlanner 
			       GoToStoppingPlacePlannerRules LeaveAlicePlanner PurchaseGasPlanner 
			       RateDumpsPlanner RateGasStationsPlannerRules SellPlanner 
			       SetGoalPlanner SitTightPlanner TakeTurnPlannerRules)
	(CLASSES Planner)
	(FNS AtCurrentStopPlanner BuyGasPlanner BuyPlanner CarryOutGoalPlanner 
	     FindStoppingPlacePlannerRules GetClosePlanner GoToAlicePlanner 
	     GoToStoppingPlacePlannerRules LeaveAlicePlanner PurchaseGasPlanner RateDumpsPlanner 
	     RateGasStationsPlannerRules SellPlanner SetGoalPlanner SitTightPlanner 
	     TakeTurnPlannerRules)))
(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 NIL)
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 2)
	 (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 2)
	 (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 2)
	 (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 2)
	 (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 (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 3)
	 (controlStructure DO1)
	 (whileCondition NIL)
	 (compilerOptions NIL)
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass))



(DEFINST RuleSet (SetGoalPlanner "UVSC@ELo")
	 (perspectiveNode #&(RuleSetNode "UVSC@EME"))
	 (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 6)
	 (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 ("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 "UVSC@EOA"))
		       (#&(Rule "UVSC@EOB"))
		       (#&(Rule "UVSC@EOC"))
		       (#&(Rule "UVSC@ENy"))
		       (#&(Rule "UNSC@8d"))
		       (#&(Rule "UNSC@8e"))
		       (#&(Rule "UNSC@8f"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@ENF") myViewName Source)
	 (created " 1-FEB-83 14:25:34")
	 (creator LOOPSCOURSE)
	 (edited "23-JUN-83 12:04:08")
	 (editor MITTAL))



(DEFINST RuleSetSource ("UVSC@EMH")
	 (indexedVars ((#&(Rule "UVSC@EMR"))
		       (#&(Rule "UVSC@EMS"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@EM>"))
	 (created "22-JUN-83 17:07:59")
	 (creator MITTAL)
	 (edited "22-JUN-83 17:25:00")
	 (editor MITTAL))



(DEFINST RuleSetSource ("UVSC@EMI")
	 (indexedVars ((#&(Rule "UVSC@ENS"))
		       (#&(Rule "UVSC@ENT"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@EM?"))
	 (created "22-JUN-83 17:15:22")
	 (creator MITTAL)
	 (edited "23-JUN-83 09:46:23")
	 (editor MITTAL))



(DEFINST RuleSetSource ("UVSC@ENL")
	 (indexedVars ((#&(Rule "UVSC@EOD"))
		       (#&(Rule "UVSC@EOE"))
		       (#&(Rule "UVSC@EOF"))
		       (#&(Rule "UVSC@EOG"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@ENG"))
	 (created "23-JUN-83 10:16:54")
	 (creator MITTAL)
	 (edited "23-JUN-83 13:23:54")
	 (editor MITTAL))



(DEFINST RuleSetSource ("UVSC@ENM")
	 (indexedVars ((#&(Rule "UVSC@EMx"))
		       (#&(Rule "UVSC@EMy"))
		       (#&(Rule "UVSC@EMz"))
		       (#&(Rule "UVSC@EM{"))
		       (#&(Rule "UVSC@EM|"))
		       (#&(Rule "UISC@@PN"))
		       (#&(Rule "FAS@@&Lp"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@ENH") myViewName Source)
	 (created " 1-FEB-83 14:25:23")
	 (creator LOOPSCOURSE)
	 (edited "23-JUN-83 09:55:11")
	 (editor MITTAL))



(DEFINST RuleSetSource ("UVSC@EMJ")
	 (indexedVars ((#&(Rule "UVSC@EOS"))
		       (#&(Rule "UVSC@EOT"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@EM@"))
	 (created "22-JUN-83 16:47:34")
	 (creator MITTAL)
	 (edited "23-JUN-83 14:05:32")
	 (editor MITTAL))



(DEFINST RuleSetSource ("UVSC@EMK")
	 (indexedVars ((#&(Rule "UVSC@ENY"))
		       (#&(Rule "UVSC@ENZ"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@EMA"))
	 (created "22-JUN-83 16:49:44")
	 (creator MITTAL)
	 (edited "23-JUN-83 09:48:00")
	 (editor MITTAL))



(DEFINST RuleSetSource ("UVSC@ENN")
	 (indexedVars ((#&(Rule "UVSC@EN["))
		       (#&(Rule "UVSC@EN\"))
		       (#&(Rule "UVSC@EN]"))
		       (#&(Rule "UNSC@8c"))
		       (#&(Rule "UNSC@8d"))
		       (#&(Rule "UNSC@8e"))
		       (#&(Rule "UNSC@8f"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@ENI") myViewName Source)
	 (created " 1-FEB-83 14:25:34")
	 (creator LOOPSCOURSE)
	 (edited "23-JUN-83 10:04:26")
	 (editor MITTAL))



(DEFINST RuleSetSource ("UVSC@EML")
	 (indexedVars ((#&(Rule "UVSC@EMZ"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@EMB"))
	 (created "22-JUN-83 16:41:38")
	 (creator MITTAL)
	 (edited "22-JUN-83 16:46:04")
	 (editor MITTAL))



(DEFINST RuleSetSource ("UVSC@EO@")
	 (indexedVars ((#&(Rule "UVSC@EOH"))
		       (#&(Rule "UVSC@EOI"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@EO?") myViewName Source)
	 (created "27-JAN-83 00:31:21")
	 (creator STEFIK)
	 (edited "23-JUN-83 12:41:21")
	 (editor MITTAL))



(DEFINST RuleSetSource ("UVSC@EMM")
	 (indexedVars ((#&(Rule "UVSC@EM["))
		       (#&(Rule "UVSC@EM\"))
		       (#&(Rule "UVSC@EM]"))
		       (#&(Rule "UVSC@EM↑"))
		       (#&(Rule "UVSC@EM←"))
		       (#&(Rule "UISC@AM\"))
		       (#&(Rule "UISC@AM]"))
		       (#&(Rule "UISC@AM↑"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@EMC") myViewName Source)
	 (created "18-FEB-83 22:45:14")
	 (creator STEFIK)
	 (edited "22-JUN-83 18:11:27")
	 (editor MITTAL))



(DEFINST RuleSetSource ("UVSC@ENO")
	 (indexedVars ((#&(Rule "UVSC@EN↑"))
		       (#&(Rule "UVSC@EN←"))
		       (#&(Rule "UVSC@EN`"))
		       (#&(Rule "UOSC@E\s"))
		       (#&(Rule "UOSC@E\t"))
		       (#&(Rule "UOSC@E\u"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@ENJ") myViewName Source)
	 (created "19-MAY-83 17:26:44")
	 (creator MITTAL)
	 (edited "23-JUN-83 10:36:01")
	 (editor MITTAL))



(DEFINST RuleSetSource ("UVSC@EMN")
	 (indexedVars ((#&(Rule "UVSC@EOJ"))
		       (#&(Rule "UVSC@EOK"))
		       (#&(Rule "UVSC@EOL"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@EMD"))
	 (created "22-JUN-83 17:30:30")
	 (creator MITTAL)
	 (edited "23-JUN-83 11:46:31")
	 (editor MITTAL))



(DEFINST RuleSetSource ("UVSC@EMO")
	 (indexedVars ((#&(Rule "UVSC@EOU"))
		       (#&(Rule "UVSC@EOV"))
		       (#&(Rule "UVSC@EOW"))
		       (#&(Rule "UVSC@EOX"))
		       (#&(Rule "UVSC@EOY"))
		       (#&(Rule "UVSC@EOZ"))
		       (#&(Rule "UVSC@EO["))
		       (#&(Rule "UVSC@EO\"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@EME"))
	 (created "22-JUN-83 15:37:14")
	 (creator MITTAL)
	 (edited "23-JUN-83 13:57:39")
	 (editor MITTAL))



(DEFINST RuleSetSource ("UVSC@EMP")
	 (indexedVars ((#&(Rule "UVSC@EMk"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@EMF"))
	 (created "22-JUN-83 16:39:26")
	 (creator MITTAL)
	 (edited "22-JUN-83 16:40:24")
	 (editor MITTAL))



(DEFINST RuleSetSource ("UVSC@EMQ")
	 (indexedVars ((#&(Rule "UVSC@EOM"))
		       (#&(Rule "UVSC@EO="))
		       (#&(Rule "UVSC@EON"))
		       (#&(Rule "UVSC@EOO"))
		       (#&(Rule "UVSC@EOP"))
		       (#&(Rule "UVSC@EOQ"))
		       (#&(Rule "UVSC@EOR"))
		       (#&(Rule "UNSC@8g"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@EMG") myViewName Source)
	 (created " 1-FEB-83 14:25:51")
	 (creator LOOPSCOURSE)
	 (edited "23-JUN-83 13:01:58")
	 (editor MITTAL))



(DEFINST Rule ("UVSC@EOA")
	 (source "(* Take action at current stop)

-> realLocation←truck:location;")
	 (edited "23-JUN-83 12:04:08")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@EN@")))



(DEFINST Rule ("UVSC@EOB")
	 (source 

"IF stoppingPlace realLocation~=stoppingPlace 
 THEN (WriteGameStatus %"Oh! %" driver %" didnt reach stoppingPlace%");")
	 (edited "23-JUN-83 12:04:08")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "UVSC@EN@")))



(DEFINST Rule ("UVSC@EOC")
	 (source "IF (ISA realLocation $GasStation)
 THEN .PurchaseGas;")
	 (edited "23-JUN-83 12:04:08")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "UVSC@EN@")))



(DEFINST Rule ("UVSC@ENy")
	 (source "IF realLocation=destination 
 THEN .CarryOutGoal  destination←NIL;")
	 (edited "23-JUN-83 12:04:08")
	 (editor MITTAL)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "UVSC@EN@")))



(DEFINST Rule ("UNSC@8d")
	 (source "	IF (ISA realLocation $GasStation)
	THEN .BuyGas;")
	 (edited "14-JUN-83 14:07:23")
	 (editor MITTAL)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "FRSC@$PA")))



(DEFINST Rule ("UNSC@8e")
	 (source 

"	IF (ISA realLocation $Producer) ~(ISA realLocation $GasStation)
           goal='Peddle
	   realLocation=destination 
           numBuy←(← self MaxPurchase realLocation)
           numBuy>=1  
	THEN (← \gameMaster Buy numBuy);")
	 (edited "14-JUN-83 14:07:23")
	 (editor MITTAL)
	 (ruleNumber 6)
	 (ruleSet #&(RuleSet "FRSC@$PA")))



(DEFINST Rule ("UNSC@8f")
	 (source "	IF (ISA realLocation $Consumer) truck:cargo
	THEN .SellGoods;")
	 (edited "14-JUN-83 14:07:23")
	 (editor MITTAL)
	 (ruleNumber 7)
	 (ruleSet #&(RuleSet "FRSC@$PA")))



(DEFINST Rule ("UVSC@EMR")
	 (source "IF prevGoal=goal THEN ;")
	 (edited "22-JUN-83 17:25:00")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@ELu")))



(DEFINST Rule ("UVSC@EMS")
	 (source 

"-> destination←(PickHiObj self 'RateGasStations (RoadStops $GasStation .Range))
   direction←(DirectionOf destination);")
	 (edited "22-JUN-83 17:25:00")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "UVSC@ELu")))



(DEFINST Rule ("UVSC@ENS")
	 (source "IF prevGoal=goal destination destination:qty>0 THEN ;")
	 (edited "23-JUN-83 09:46:23")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@ELv")))



(DEFINST Rule ("UVSC@ENT")
	 (source 

"IF sellers←(Sellers $Commodity)
  tdest←(PickHiObj self 'RateProducers sellers)
 THEN destination←tdest
        direction←(DirectionOf destination);")
	 (edited "23-JUN-83 09:46:23")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "UVSC@ELv")))



(DEFINST Rule ("UVSC@EOD")
	 (source 

"(* Carry out goal, revising them if needed)
IF goal << '(LeaveAlice SitTight GetClose GoToAlice) 
 THEN ;")
	 (edited "23-JUN-83 13:23:54")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@ENA")))



(DEFINST Rule ("UVSC@EOE")
	 (source "IF goal='BuyGas THEN goal←NIL;")
	 (edited "23-JUN-83 13:23:54")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "UVSC@ENA")))



(DEFINST Rule ("UVSC@EOF")
	 (source 

"IF goal='Buy numBuy←(← self MaxPurchase truck:location)
   numBuy>= 1
 THEN (← \gameMaster Buy numBuy);")
	 (edited "23-JUN-83 13:23:54")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "UVSC@ENA")))



(DEFINST Rule ("UVSC@EOG")
	 (source "IF goal='Sell truck:cargo
 THEN .SellGoods;")
	 (edited "23-JUN-83 13:23:54")
	 (editor MITTAL)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "UVSC@ENA")))



(DEFINST Rule ("UVSC@EMx")
	 (source 

"(* Returns a stopping place en route to a destination.)

IF truck:fuel=0
THEN stoppingPlace←(AnyRoadStop $UnionHall);")
	 (edited "23-JUN-83 09:55:11")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@EMq")))



(DEFINST Rule ("UVSC@EMy")
	 (source 

"(* Obey the law - stop at WeighStations.)
IF wStation←(NearestRoadStop (RoadStops $WeighStation .Range1 direction 'Room))
   (Distance wStation)<(Distance destination) 
THEN stoppingPlace←wStation;")
	 (edited "23-JUN-83 09:55:11")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "UVSC@EMq")))



(DEFINST Rule ("UVSC@EMz")
	 (source 
   "IF (Distance destination)<=.Range1 (RoomToParkP destination)
THEN stoppingPlace←destination;")
	 (edited "23-JUN-83 09:55:11")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "UVSC@EMq")))



(DEFINST Rule ("UVSC@EM{")
	 (source 

"IF gasStation←(FurthestRoadStop (RoadStops $GasStation .Range1 direction 'Room))
   gasStation:qty>0
THEN stoppingPlace←gasStation;")
	 (edited "23-JUN-83 09:55:11")
	 (editor MITTAL)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "UVSC@EMq")))



(DEFINST Rule ("UVSC@EM|")
	 (source "THEN stoppingPlace←(NthRoadStop  \maxMove direction NIL 'Room);")
	 (edited "23-JUN-83 09:55:11")
	 (editor MITTAL)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "UVSC@EMq")))



(DEFINST Rule ("UISC@@PN")
	 (source "THEN stoppingPlace←(NthRoadStop  \maxMove direction NIL 'Room);")
	 (edited " 9-JUN-83 11:24:42")
	 (editor STEFIK)
	 (ruleNumber 6)
	 (ruleSet #&(RuleSet "FRSC@$Oz")))



[DEFINST Rule ("FAS@@&Lp")
	 (source NIL)
	 (edited " 1-FEB-83 14:25:33")
	 (editor "LOOPSCOURSE")
	 (ruleNumber 7)
	 (ruleSet #&(RuleSet "FAS@@&Li"))
	 (lhs (AND))
	 (rhs (SETQ ↑value (PROGN (PROGN                     (* Rule Tracing Code)
					 (TraceRHS NIL 7)
					 (← (GetObjFromUID "FAS@@&Lp")
					    Print))
				  (NthRoadStop maxMove (GetValue self (QUOTE direction]



(DEFINST Rule ("UVSC@EOS")
	 (source "IF prevGoal=goal alices (RoomToParkP alices) THEN ;")
	 (edited "23-JUN-83 14:05:32")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@ELr")))



(DEFINST Rule ("UVSC@EOT")
	 (source 

"-> alices←(NearestRoadStop(RoadStops $AlicesRestaurant ))
   destination←(PickHiObj self 'RateSpotsNearAlices (RoadStops))
   direction← (DirectionOf destination);")
	 (edited "23-JUN-83 14:05:32")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "UVSC@ELr")))



(DEFINST Rule ("UVSC@ENY")
	 (source "IF prevGoal=goal destination (RoomToParkP destination) THEN;")
	 (edited "23-JUN-83 09:48:00")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@ELs")))



(DEFINST Rule ("UVSC@ENZ")
	 (source 

"IF  tdest← (NearestRoadStop(RoadStops $AlicesRestaurant NIL NIL T))
 THEN   destination←tdest
          direction ← (DirectionOf destination);")
	 (edited "23-JUN-83 09:48:00")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "UVSC@ELs")))



(DEFINST Rule ("UVSC@EN[")
	 (source 

"(* Go to the stoppingPlace)
IF stoppingPlace=truck:location
 THEN (WriteGameStatus %"Hm! %" driver %" already there%");")
	 (edited "23-JUN-83 10:04:26")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@EN=")))



(DEFINST Rule ("UVSC@EN\")
	 (source 
   "IF stoppingPlace.BanditP
 THEN (WriteGameStatus  driver %" Not moving because of bandits%");")
	 (edited "23-JUN-83 10:04:26")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "UVSC@EN=")))



(DEFINST Rule ("UVSC@EN]")
	 (source "-> (← \gameMaster Move stoppingPlace);")
	 (edited "23-JUN-83 10:04:26")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "UVSC@EN=")))



(DEFINST Rule ("UNSC@8c")
	 (source 
       "	IF realLocation~=stoppingPlace 
	THEN (WriteGameStatus %">> %" self %" intercepted!%");")
	 (edited "14-JUN-83 14:07:23")
	 (editor MITTAL)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "FRSC@$PA")))



(DEFINST Rule ("UVSC@EMZ")
	 (source 

"-> destination← (NearestRoadStop (RoadStops $RoadStop NIL NIL T))
   direction← (DirectionOf destination);")
	 (edited "22-JUN-83 16:46:04")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@ELq")))



(DEFINST Rule ("UVSC@EOH")
	 (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 "23-JUN-83 12:41:21")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@ENx")))



(DEFINST Rule ("UVSC@EOI")
	 (source 
"(* Now appropriate quantity has been computed)

    IF qty>0
     THEN  (← \gameMaster Buy qty );")
	 (edited "23-JUN-83 12:41:21")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "UVSC@ENx")))



(DEFINST Rule ("UVSC@EM[")
	 (source 
      "	(* Rate the suitability of a proposed Consumer.)

-> cargo ← (CAR truck:cargo) rating←0;")
	 (edited "22-JUN-83 18:11:27")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@EL|")))



(DEFINST Rule ("UVSC@EM\")
	 (source 
	  "(* Need to be able to park)
 IF ~(RoomToParkP roadStop)
  THEN rating ← rating - 500;")
	 (edited "22-JUN-83 18:11:27")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "UVSC@EL|")))



(DEFINST Rule ("UVSC@EM]")
	 (source 
"(* Exclude consumers that have full inventory.)
 IF roadStop:qty < 1
  THEN rating ← rating - 1000;")
	 (edited "22-JUN-83 18:11:27")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "UVSC@EL|")))



(DEFINST Rule ("UVSC@EM↑")
	 (source "(* Favor high price ratios.)
  -> rating ← rating + 100 * roadStop:pr ;")
	 (edited "22-JUN-83 18:11:27")
	 (editor MITTAL)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "UVSC@EL|")))



(DEFINST Rule ("UVSC@EM←")
	 (source 
"(* Favor close places.)
  -> rating ← rating - [truck::Gpm *(Distance roadStop truck:location)];")
	 (edited "22-JUN-83 18:11:27")
	 (editor MITTAL)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "UVSC@EL|")))



(DEFINST Rule ("UISC@AM\")
	 (source 
"(* Exclude consumers that have full inventory.)
 IF roadStop:qty < 1
  THEN rating ← rating - 1000;")
	 (edited " 9-JUN-83 21:28:08")
	 (editor STEFIK)
	 (ruleNumber 6)
	 (ruleSet #&(RuleSet "FRSC@$RX")))



(DEFINST Rule ("UISC@AM]")
	 (source "(* Favor high price ratios.)
  -> rating ← rating + 100 * roadStop:pr ;")
	 (edited " 9-JUN-83 21:28:08")
	 (editor STEFIK)
	 (ruleNumber 7)
	 (ruleSet #&(RuleSet "FRSC@$RX")))



(DEFINST Rule ("UISC@AM↑")
	 (source 
"(* Favor close places.)
  -> rating ← rating - [truck::Gpm *(Distance roadStop truck:location)];")
	 (edited " 9-JUN-83 21:28:08")
	 (editor STEFIK)
	 (ruleNumber 8)
	 (ruleSet #&(RuleSet "FRSC@$RX")))



(DEFINST Rule ("UVSC@EN↑")
	 (source "(* rate gas stations within range)
 THEN rating ← 0;")
	 (edited "23-JUN-83 10:36:01")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@ENC")))



(DEFINST Rule ("UVSC@EN←")
	 (source "IF rs:qty=0 
 THEN rating ← -2000;")
	 (edited "23-JUN-83 10:36:01")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "UVSC@ENC")))



(DEFINST Rule ("UVSC@EN`")
	 (source "IF ~(RoomToParkP rs)
 THEN rating ← rating - 200;")
	 (edited "23-JUN-83 10:36:01")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "UVSC@ENC")))



(DEFINST Rule ("UOSC@E\s")
	 (source "IF rs.BanditP
 THEN rating ← rating - 200;")
	 (edited "15-JUN-83 17:46:12")
	 (editor MITTAL)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "YSSC@<>m")))



(DEFINST Rule ("UOSC@E\t")
	 (source " THEN rating ← rating - [10 * (Distance rs truck:location)];")
	 (edited "15-JUN-83 17:46:12")
	 (editor MITTAL)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "YSSC@<>m")))



(DEFINST Rule ("UOSC@E\u")
	 (source " THEN rating ← rating + (IMIN rs:qty truck::MaxFuel);")
	 (edited "15-JUN-83 17:46:12")
	 (editor MITTAL)
	 (ruleNumber 6)
	 (ruleSet #&(RuleSet "YSSC@<>m")))



(DEFINST Rule ("UVSC@EOJ")
	 (source 
	 "IF  has←(CAR truck:cargo) prevGoal=goal has:status destination destination:qty>0 THEN;")
	 (edited "23-JUN-83 11:46:31")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@ELx")))



(DEFINST Rule ("UVSC@EOK")
	 (source 

"IF ~has:status tdest←(PickHiObj self 'RateDumps (RoadStops $CityDump))
 THEN destination←tdest direction←(DirectionOf destination);")
	 (edited "23-JUN-83 11:46:31")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "UVSC@ELx")))



(DEFINST Rule ("UVSC@EOL")
	 (source 

"IF tdest←(PickHiObj self 'RateConsumers (Buyers has))
 THEN destination←tdest  direction←(DirectionOf destination);")
	 (edited "23-JUN-83 11:46:31")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "UVSC@ELx")))



(DEFINST Rule ("UVSC@EOU")
	 (source 
"(* Sets the goal)

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



(DEFINST Rule ("UVSC@EOV")
	 (source "IF goal << '(SitTight BuyGas) THEN ;")
	 (edited "23-JUN-83 13:57:39")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "UVSC@ELo")))



(DEFINST Rule ("UVSC@EOW")
	 (source "IF goal='GoToAlice (ISA truck:location $AlicesRestaurant) 
 THEN goal←'SitTight;")
	 (edited "23-JUN-83 13:57:39")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "UVSC@ELo")))



(DEFINST Rule ("UVSC@EOX")
	 (source "IF \gameMaster:timeRemaining <30
 THEN goal←'GoToAlice higherGoal←'GoToAlice;")
	 (edited "23-JUN-83 13:57:39")
	 (editor MITTAL)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "UVSC@ELo")))



(DEFINST Rule ("UVSC@EOY")
	 (source 
    "IF truck:fuel < .25 * truck::MaxFuel  truck:cashBox > 0
 THEN higherGoal←goal goal←'BuyGas;")
	 (edited "23-JUN-83 13:57:39")
	 (editor MITTAL)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "UVSC@ELo")))



(DEFINST Rule ("UVSC@EOZ")
	 (source "IF \gameMaster:timeRemaining < 60 
 THEN goal←'GetClose higherGoal←'GoToAlice;")
	 (edited "23-JUN-83 13:57:39")
	 (editor MITTAL)
	 (ruleNumber 6)
	 (ruleSet #&(RuleSet "UVSC@ELo")))



(DEFINST Rule ("UVSC@EO[")
	 (source "IF truck:cargo
 THEN goal←'Sell;")
	 (edited "23-JUN-83 13:57:39")
	 (editor MITTAL)
	 (ruleNumber 7)
	 (ruleSet #&(RuleSet "UVSC@ELo")))



(DEFINST Rule ("UVSC@EO\")
	 (source "-> goal←'Buy;")
	 (edited "23-JUN-83 13:57:39")
	 (editor MITTAL)
	 (ruleNumber 8)
	 (ruleSet #&(RuleSet "UVSC@ELo")))



(DEFINST Rule ("UVSC@EMk")
	 (source "-> destination←NIL;")
	 (edited "22-JUN-83 16:40:24")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@ELp")))



(DEFINST Rule ("UVSC@EOM")
	 (source 

"   (* Top-Level RuleSet for taking turns.  Sets goal and destination.)

(* this is for cases when gas station replenished since last turn)
 IF (ISA truck:location $GasStation)
 THEN .PurchaseGas;")
	 (edited "23-JUN-83 13:01:58")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@ELg")))



(DEFINST Rule ("UVSC@EO=")
	 (source " -> prevGoal←goal;")
	 (edited "23-JUN-83 13:01:58")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "UVSC@ELg")))



(DEFINST Rule ("UVSC@EON")
	 (source " ->  .SetGoal;")
	 (edited "23-JUN-83 13:01:58")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "UVSC@ELg")))



(DEFINST Rule ("UVSC@EOO")
	 (source "IF goal THEN (←! self goal);")
	 (edited "23-JUN-83 13:01:58")
	 (editor MITTAL)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "UVSC@ELg")))



(DEFINST Rule ("UVSC@EOP")
	 (source "IF destination THEN .FindStoppingPlace;")
	 (edited "23-JUN-83 13:01:58")
	 (editor MITTAL)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "UVSC@ELg")))



(DEFINST Rule ("UVSC@EOQ")
	 (source 

"(* the second action may be split into a separate rule and moved to the top)
IF destination stoppingPlace 
 THEN .GoToStoppingPlace
        .AtCurrentStop;")
	 (edited "23-JUN-83 13:01:58")
	 (editor MITTAL)
	 (ruleNumber 6)
	 (ruleSet #&(RuleSet "UVSC@ELg")))



(DEFINST Rule ("UVSC@EOR")
	 (source "(* this clause may be moved to the top)
-> .AtCurrentStop;")
	 (edited "23-JUN-83 12:57:12")
	 (editor MITTAL)
	 (ruleNumber 7)
	 (ruleSet #&(RuleSet "UVSC@ELg")))



(DEFINST Rule ("UNSC@8g")
	 (source 

"IF ~(OR goal='SitTight 
       (AND goal='GetClose (Distance truck:location alices)<=3))
 THEN .GoToStoppingPlace;")
	 (edited "14-JUN-83 14:29:23")
	 (editor MITTAL)
	 (ruleNumber 8)
	 (ruleSet #&(RuleSet "YQSC@<?t")))



(DEFINST RuleSet (GoToStoppingPlacePeddlerRules "FRSC@$PA")
	 (perspectiveNode #&(RuleSetNode "FRSC@$PG") myViewName RuleSet)
	 (name #(GoToStoppingPlacePeddlerRules NIL RememberName))
	 (compiledRules GoToStoppingPlacePeddlerRules)
	 (workSpace Peddler)
	 (args NIL)
	 (tempVars (realLocation numBuy))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 7)
	 (controlStructure DOALL)
	 (whileCondition NIL)
	 (compilerOptions (A))
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass)
	 (arguments))



(DEFINST RuleSet (FindStoppingPlacePeddlerRules "FRSC@$Oz")
	 (perspectiveNode #&(RuleSetNode "FRSC@$PF") myViewName RuleSet)
	 (name #(FindStoppingPlacePeddlerRules NIL RememberName))
	 (compiledRules FindStoppingPlacePeddlerRules)
	 (workSpace Peddler)
	 (args NIL)
	 (tempVars (wStation gasStation))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 6)
	 (controlStructure DO1)
	 (whileCondition NIL)
	 (compilerOptions (A))
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass)
	 (arguments))



(DEFINST RuleSet (FindStoppingPlaceToyotaRules "FAS@@&Li")
	 (perspectiveNode #&(RuleSetNode "FAS@@&Mh") myViewName RuleSet)
	 (name #(FindStoppingPlaceToyotaRules NIL RememberName))
	 (compiledRules FindStoppingPlaceToyotaRules)
	 (workSpace Toyota)
	 (args)
	 (tempVars (wStation gasStation))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 6)
	 (controlStructure DOALL)
	 (whileCondition NIL)
	 (compilerOptions NIL)
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass)
	 (arguments))



(DEFINST RuleSet (PeddlerRateConsumers "FRSC@$RX")
	 (perspectiveNode #&(RuleSetNode "FRSC@$Re") myViewName RuleSet)
	 (name #(PeddlerRateConsumers NIL RememberName))
	 (compiledRules PeddlerRateConsumers)
	 (workSpace Peddler)
	 (args (roadStop))
	 (tempVars (rating cargo))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 8)
	 (controlStructure DOALL)
	 (whileCondition NIL)
	 (compilerOptions (A))
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass)
	 (arguments))



(DEFINST RuleSet (HPRateGasStations "YSSC@<>m")
	 (perspectiveNode #&(RuleSetNode "YSSC@<>s") myViewName RuleSet)
	 (name #(HPRateGasStations NIL RememberName))
	 (compiledRules HPRateGasStations)
	 (workSpace HousePlayer)
	 (args (rs))
	 (tempVars (rating))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 6)
	 (controlStructure DOALL)
	 (whileCondition NIL)
	 (compilerOptions (A))
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass)
	 (arguments))



(DEFINST RuleSet (TakeTurnPeddlerRules "YQSC@<?t")
	 (perspectiveNode #&(RuleSetNode "YQSC@<@I") myViewName RuleSet)
	 (name #(TakeTurnPeddlerRules NIL RememberName))
	 (compiledRules TakeTurnPeddlerRules)
	 (workSpace Peddler)
	 (args NIL)
	 (tempVars (possibleStops))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 8)
	 (controlStructure DOALL)
	 (whileCondition NIL)
	 (compilerOptions (A))
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass)
	 (arguments))



(DEFINST RuleSetNode ("FRSC@$PG")
	 (perspectives ? RuleSet #&(RuleSet "FRSC@$PA") Source #&(RuleSetSource "FRSC@$PL")))



(DEFINST RuleSetNode ("FRSC@$PF")
	 (perspectives ? RuleSet #&(RuleSet "FRSC@$Oz") Source #&(RuleSetSource "FRSC@$PK")))



(DEFINST RuleSetNode ("FAS@@&Mh")
	 (perspectives ? RuleSet #&(RuleSet "FAS@@&Li") Source #&(RuleSetSource "FAS@@&Mn")))



(DEFINST RuleSetNode ("FRSC@$Re")
	 (perspectives ? RuleSet #&(RuleSet "FRSC@$RX") Source #&(RuleSetSource "FRSC@$Ro")))



(DEFINST RuleSetNode ("YSSC@<>s")
	 (perspectives ? RuleSet #&(RuleSet "YSSC@<>m") Source #&(RuleSetSource "YSSC@<>u")))



(DEFINST RuleSetNode ("YQSC@<@I")
	 (perspectives ? RuleSet #&(RuleSet "YQSC@<?t") Source #&(RuleSetSource "YQSC@<@J")))



(DEFINST RuleSetSource ("FRSC@$PL")
	 (indexedVars ((#&(Rule "UNSC@8E"))
		       (#&(Rule "UNSC@8a"))
		       (#&(Rule "UNSC@8b"))
		       (#&(Rule "UNSC@8c"))
		       (#&(Rule "UNSC@8d"))
		       (#&(Rule "UNSC@8e"))
		       (#&(Rule "UNSC@8f"))))
	 (perspectiveNode #&(RuleSetNode "FRSC@$PG") myViewName Source)
	 (created " 1-FEB-83 14:25:34")
	 (creator LOOPSCOURSE)
	 (edited "14-JUN-83 14:07:23")
	 (editor MITTAL))



(DEFINST RuleSetSource ("FRSC@$PK")
	 (indexedVars ((#&(Rule "UISC@@PI"))
		       (#&(Rule "UISC@@PJ"))
		       (#&(Rule "UISC@@PK"))
		       (#&(Rule "UISC@@PL"))
		       (#&(Rule "UISC@@PM"))
		       (#&(Rule "UISC@@PN"))
		       (#&(Rule "FAS@@&Lp"))))
	 (perspectiveNode #&(RuleSetNode "FRSC@$PF") myViewName Source)
	 (created " 1-FEB-83 14:25:23")
	 (creator LOOPSCOURSE)
	 (edited " 9-JUN-83 11:24:42")
	 (editor STEFIK))



(DEFINST RuleSetSource ("FAS@@&Mn")
	 (indexedVars ((#&(Rule "FPSC@$Lw"))
		       (#&(Rule "FPSC@$Lx"))
		       (#&(Rule "FPSC@$Ly"))
		       (#&(Rule "FPSC@$Lz"))
		       (#&(Rule "FPSC@$L{"))
		       (#&(Rule "FPSC@$L|"))
		       (#&(Rule "FAS@@&Lp"))))
	 (perspectiveNode #&(RuleSetNode "FAS@@&Mh") myViewName Source)
	 (created " 1-FEB-83 14:25:23")
	 (creator LOOPSCOURSE)
	 (edited "16-FEB-83 14:44:17")
	 (editor STEFIK))



(DEFINST RuleSetSource ("FRSC@$Ro")
	 (indexedVars ((#&(Rule "UISC@AMW"))
		       (#&(Rule "UISC@AMX"))
		       (#&(Rule "UISC@AMY"))
		       (#&(Rule "UISC@AMZ"))
		       (#&(Rule "UISC@AM["))
		       (#&(Rule "UISC@AM\"))
		       (#&(Rule "UISC@AM]"))
		       (#&(Rule "UISC@AM↑"))))
	 (perspectiveNode #&(RuleSetNode "FRSC@$Re") myViewName Source)
	 (created "18-FEB-83 22:45:14")
	 (creator STEFIK)
	 (edited " 9-JUN-83 21:28:08")
	 (editor STEFIK))



(DEFINST RuleSetSource ("YSSC@<>u")
	 (indexedVars ((#&(Rule "UOSC@E\p"))
		       (#&(Rule "UOSC@E\q"))
		       (#&(Rule "UOSC@E\r"))
		       (#&(Rule "UOSC@E\s"))
		       (#&(Rule "UOSC@E\t"))
		       (#&(Rule "UOSC@E\u"))))
	 (perspectiveNode #&(RuleSetNode "YSSC@<>s") myViewName Source)
	 (created "19-MAY-83 17:26:44")
	 (creator MITTAL)
	 (edited "15-JUN-83 17:46:12")
	 (editor MITTAL))



(DEFINST RuleSetSource ("YQSC@<@J")
	 (indexedVars ((#&(Rule "UNSC@8F"))
		       (#&(Rule "UNSC@8G"))
		       (#&(Rule "UNSC@8H"))
		       (#&(Rule "UNSC@8I"))
		       (#&(Rule "UNSC@8J"))
		       (#&(Rule "UNSC@8K"))
		       (#&(Rule "UNSC@8L"))
		       (#&(Rule "UNSC@8g"))))
	 (perspectiveNode #&(RuleSetNode "YQSC@<@I") myViewName Source)
	 (created " 1-FEB-83 14:25:51")
	 (creator LOOPSCOURSE)
	 (edited "14-JUN-83 14:29:23")
	 (editor MITTAL))



(DEFINST Rule ("UNSC@8E")
	 (source "	-> direction←(DirectionOf destination);")
	 (edited "14-JUN-83 14:07:23")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "FRSC@$PA")))



(DEFINST Rule ("UNSC@8a")
	 (source 

"	IF .FindStoppingPlace stoppingPlace~=truck:location
          ~stoppingPlace.BanditP
	THEN (← \gameMaster Move stoppingPlace);")
	 (edited "14-JUN-83 14:07:23")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "FRSC@$PA")))



(DEFINST Rule ("UNSC@8b")
	 (source "        -> realLocation←truck:location;")
	 (edited "14-JUN-83 14:07:23")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "FRSC@$PA")))



(DEFINST Rule ("UISC@@PI")
	 (source 

"(* Returns a stopping place en route to a destination.)

IF truck:fuel=0
THEN stoppingPlace←(AnyRoadStop $UnionHall);")
	 (edited " 9-JUN-83 11:24:42")
	 (editor STEFIK)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "FRSC@$Oz")))



(DEFINST Rule ("UISC@@PJ")
	 (source 

"(* Dont run out of gas.)
IF goal~='SitTight 
   truck:fuel < .25 * truck::MaxFuel
   truck:cashBox>0
   gasStation←(NearestRoadStop (RoadStops $GasStation .Range1 NIL 'Room))
THEN stoppingPlace←gasStation;")
	 (edited " 9-JUN-83 11:24:42")
	 (editor STEFIK)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "FRSC@$Oz")))



(DEFINST Rule ("UISC@@PK")
	 (source 

"(* Obey the law - stop at WeighStations.)
IF wStation←(NearestRoadStop (RoadStops $WeighStation .Range1 direction 'Room))
   (Distance wStation)<(Distance destination) 
THEN stoppingPlace←wStation;")
	 (edited " 9-JUN-83 11:24:42")
	 (editor STEFIK)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "FRSC@$Oz")))



(DEFINST Rule ("UISC@@PL")
	 (source 
   "IF (Distance destination)<=.Range1 (RoomToParkP destination)
THEN stoppingPlace←destination;")
	 (edited " 9-JUN-83 11:24:42")
	 (editor STEFIK)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "FRSC@$Oz")))



(DEFINST Rule ("UISC@@PM")
	 (source 

"IF gasStation←(FurthestRoadStop (RoadStops $GasStation .Range1 direction 'Room))
   gasStation:qty>0
THEN stoppingPlace←gasStation;")
	 (edited " 9-JUN-83 11:24:42")
	 (editor STEFIK)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "FRSC@$Oz")))



(DEFINST Rule ("FPSC@$Lw")
	 (source 

"(* Returns a stopping place en route to a destination.)

IF truck:fuel=0
THEN (AnyRoadStop $UnionHall);")
	 (edited "16-FEB-83 14:44:17")
	 (editor STEFIK)
	 (ruleNumber)
	 (ruleSet #&(RuleSet "FAS@@&Li")))



(DEFINST Rule ("FPSC@$Lx")
	 (source 

"(* Dont run out if gas.)
IF truck:fuel < .25 * truck::MaxFuel
   truck:cashBox>0
   gasStation←(NearestRoadStop (RoadStops $GasStation .Range1 NIL 'Room))
THEN gasStation;")
	 (edited "16-FEB-83 14:44:17")
	 (editor STEFIK)
	 (ruleNumber)
	 (ruleSet #&(RuleSet "FAS@@&Li")))



(DEFINST Rule ("FPSC@$Ly")
	 (source 

"(* Obey the law - stop at WeighStations.)
IF wStation←(NearestRoadStop (RoadStops $WeighStation .Range1 direction 'Room))
   (Distance wStation)<(Distance destination)
THEN wStation;")
	 (edited "16-FEB-83 14:44:17")
	 (editor STEFIK)
	 (ruleNumber)
	 (ruleSet #&(RuleSet "FAS@@&Li")))



(DEFINST Rule ("FPSC@$Lz")
	 (source "IF (Distance destination)<=.Range1
THEN destination;")
	 (edited "16-FEB-83 14:44:17")
	 (editor STEFIK)
	 (ruleNumber)
	 (ruleSet #&(RuleSet "FAS@@&Li")))



(DEFINST Rule ("FPSC@$L{")
	 (source 
    "IF gasStation←(FurthestRoadStop (RoadStops $GasStation .Range1 direction))
THEN gasStation;")
	 (edited "16-FEB-83 14:44:17")
	 (editor STEFIK)
	 (ruleNumber)
	 (ruleSet #&(RuleSet "FAS@@&Li")))



(DEFINST Rule ("FPSC@$L|")
	 (source "THEN (NthRoadStop  maxMove direction);")
	 (edited "16-FEB-83 14:44:17")
	 (editor STEFIK)
	 (ruleNumber)
	 (ruleSet #&(RuleSet "FAS@@&Li")))



(DEFINST Rule ("UISC@AMW")
	 (source 
      "	(* Rate the suitability of a proposed Consumer.)

-> cargo ← (CAR truck:cargo) rating←0;")
	 (edited " 9-JUN-83 21:28:08")
	 (editor STEFIK)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "FRSC@$RX")))



(DEFINST Rule ("UISC@AMX")
	 (source 

"(* if spoiled go to CityDump)
IF ~cargo:status (ISA roadStop $CityDump) 
THEN (STOP 5000 'CityDump 'LookNoMore);")
	 (edited " 9-JUN-83 21:28:08")
	 (editor STEFIK)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "FRSC@$RX")))



(DEFINST Rule ("UISC@AMY")
	 (source "IF ~cargo:status
THEN (STOP NIL 'SpoiltGoods 'CannotSell);")
	 (edited " 9-JUN-83 21:28:08")
	 (editor STEFIK)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "FRSC@$RX")))



(DEFINST Rule ("UISC@AMZ")
	 (source 

"(* Consumer must want current cargo.)
 IF ~(ISA cargo roadStop::Commodity)
  THEN rating ← rating - 5000;")
	 (edited " 9-JUN-83 21:28:08")
	 (editor STEFIK)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "FRSC@$RX")))



(DEFINST Rule ("UISC@AM[")
	 (source 
	  "(* Need to be able to park)
 IF ~(RoomToParkP roadStop)
  THEN rating ← rating - 500;")
	 (edited " 9-JUN-83 21:28:08")
	 (editor STEFIK)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "FRSC@$RX")))



(DEFINST Rule ("UOSC@E\p")
	 (source "(* rate gas stations within range)
 THEN rating ← 0;")
	 (edited "15-JUN-83 17:46:12")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "YSSC@<>m")))



(DEFINST Rule ("UOSC@E\q")
	 (source "IF rs:qty=0 
 THEN rating ← -2000;")
	 (edited "15-JUN-83 17:46:12")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "YSSC@<>m")))



(DEFINST Rule ("UOSC@E\r")
	 (source "IF ~(RoomToParkP rs)
 THEN rating ← rating - 200;")
	 (edited "15-JUN-83 17:46:12")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "YSSC@<>m")))



(DEFINST Rule ("UNSC@8F")
	 (source 

"   (* Top-Level RuleSet for taking turns.  Sets goal and destination.)

 IF ~goal
  THEN goal←'Peddle;")
	 (edited "14-JUN-83 14:29:23")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "YQSC@<?t")))



(DEFINST Rule ("UNSC@8G")
	 (source 

" IF truck:cargo goal='Peddle possibleStops←(RoadStops $Consumer)
  THEN destination←(PickHiObj self 'RateConsumers possibleStops);")
	 (edited "14-JUN-83 14:29:23")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "YQSC@<?t")))



(DEFINST Rule ("UNSC@8H")
	 (source 

" IF ~truck:cargo goal='Peddle possibleStops←(RoadStops $Producer)
  THEN destination←(PickHiObj self 'RateProducers possibleStops);")
	 (edited "14-JUN-83 14:29:23")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "YQSC@<?t")))



(DEFINST Rule ("UNSC@8I")
	 (source 

"(* Don't move away from Alices during endgame.)
 IF goal='GoToAlices truck:location=alices
  THEN goal←'SitTight;")
	 (edited "14-JUN-83 14:29:23")
	 (editor MITTAL)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "YQSC@<?t")))



(DEFINST Rule ("UNSC@8J")
	 (source 

"(* Except dont overstay at Alices.)
IF truck:location=alices  .TimeAtStop > 25 goal='SitTight
 THEN alices←(NearestRoadStop (RoadStops $AlicesRestaurant))
       destination← (PickHiObj self 'RateSpotsNearAlices (RoadStops))
       goal←'GetClose;")
	 (edited "14-JUN-83 14:29:23")
	 (editor MITTAL)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "YQSC@<?t")))



(DEFINST Rule ("UNSC@8K")
	 (source 

"(* Get near to Alices when time gets close)		
 IF \gameMaster:timeRemaining < 50 ~[goal<<'(SitTight GetClose GoToAlices)]  
  THEN alices←(NearestRoadStop (RoadStops $AlicesRestaurant))
       destination← (PickHiObj self 'RateSpotsNearAlices (RoadStops))
       goal←'GetClose;")
	 (edited "14-JUN-83 14:29:23")
	 (editor MITTAL)
	 (ruleNumber 6)
	 (ruleSet #&(RuleSet "YQSC@<?t")))



(DEFINST Rule ("UNSC@8L")
	 (source 

"(* Go to Alices now that it is time)
 IF \gameMaster:timeRemaining < 30 
    ~(ISA truck:location $AlicesRestaurant)   
  THEN destination← (NearestRoadStop (RoadStops $AlicesRestaurant))
       goal←'GoToAlices ;")
	 (edited "14-JUN-83 14:29:23")
	 (editor MITTAL)
	 (ruleNumber 7)
	 (ruleSet #&(RuleSet "YQSC@<?t")))



(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))
   (Methods (RateDumps RateDumpsPlanner RuleSet RateDumpsPlanner)
	    (Sell SellPlanner RuleSet SellPlanner)
	    (Buy BuyPlanner RuleSet BuyPlanner)
	    (BuyGas BuyGasPlanner RuleSet BuyGasPlanner)
	    (GoToAlice GoToAlicePlanner RuleSet GoToAlicePlanner)
	    (GetClose GetClosePlanner RuleSet GetClosePlanner)
	    (LeaveAlice LeaveAlicePlanner RuleSet LeaveAlicePlanner)
	    (SitTight SitTightPlanner RuleSet SitTightPlanner)
	    (SetGoal SetGoalPlanner RuleSet SetGoalPlanner)
	    (TakeTurn TakeTurnPlannerRules RuleSet TakeTurnPlannerRules)
	    (FindStoppingPlace FindStoppingPlacePlannerRules RuleSet FindStoppingPlacePlannerRules 
			       doc                           (* RuleSet FindStoppingPlacePeddlerRules is installed as
							     the selector FindStoppingPlace of the class Peddler)
			       )
	    (GoToStoppingPlace GoToStoppingPlacePlannerRules RuleSet GoToStoppingPlacePlannerRules 
			       doc                           (* RuleSet GoToStoppingPlacePeddlerRules is installed as
							     the selector GoToStoppingPlace of the class Peddler)
			       )
	    (AtCurrentStop AtCurrentStopPlanner RuleSet AtCurrentStopPlanner)
	    (CarryOutGoal CarryOutGoalPlanner RuleSet CarryOutGoalPlanner)
	    (RateGasStations RateGasStationsPlannerRules RuleSet RateGasStationsPlannerRules)
	    (PurchaseGas PurchaseGasPlanner RuleSet PurchaseGasPlanner))]

(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 "UVSC@ENy")))
				  (← self CarryOutGoal)
				  (PutAuditRec self (QUOTE destination)
					       NIL ↑auditRecord]
      QUIT(RETURN ↑value])

(BuyGasPlanner
  [LAMBDA (self)
    (PROG (↑value)
          [COND
	    ((EQ (GetValue self (QUOTE prevGoal))
		 (GetValue self (QUOTE goal)))
	      (SETQ ↑value (PROGN)))
	    (T (SETQ ↑value (PROGN [PutValue self (QUOTE destination)
					     (PickHiObj self (QUOTE RateGasStations)
							(RoadStops ($ GasStation)
								   (← self Range]
				   (PutValue self (QUOTE direction)
					     (DirectionOf (GetValue self (QUOTE destination]
      QUIT(RETURN ↑value])

(BuyPlanner
  [LAMBDA (self)
    (PROG (↑value tdest)
          [COND
	    ((AND (EQ (GetValue self (QUOTE prevGoal))
		      (GetValue self (QUOTE goal)))
		  (GetValue self (QUOTE destination))
		  (GREATERP (GetValue (GetValue self (QUOTE destination))
				      (QUOTE qty))
			    0))
	      (SETQ ↑value (PROGN)))
	    ([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 (← gameMaster Buy 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 "UVSC@EMx")))
				  (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 "UVSC@EMy")))
				  (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 "UVSC@EMz")))
				  (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 "UVSC@EM{")))
				  (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 "UVSC@EM|")))
				   (PutAuditRec self (QUOTE stoppingPlace)
						(NthRoadStop maxMove (GetValue self (QUOTE direction))
							     NIL
							     (QUOTE Room))
						↑auditRecord]
      QUIT(RETURN ↑value])

(GetClosePlanner
  [LAMBDA (self)
    (PROG (↑value)
          [COND
	    ([AND (EQ (GetValue self (QUOTE prevGoal))
		      (GetValue self (QUOTE goal)))
		  (GetValue self (QUOTE alices))
		  (RoomToParkP (GetValue self (QUOTE alices]
	      (SETQ ↑value (PROGN)))
	    (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
	    ([AND (EQ (GetValue self (QUOTE prevGoal))
		      (GetValue self (QUOTE goal)))
		  (GetValue self (QUOTE destination))
		  (RoomToParkP (GetValue self (QUOTE destination]
	      (SETQ ↑value (PROGN)))
	    ((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 (← gameMaster Move (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 (← gameMaster Buy 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])

(SellPlanner
  [LAMBDA (self)
    (PROG (↑value tdest has)
          [COND
	    ((AND [SETQ has (CAR (GetValue (GetValue self (QUOTE truck))
					   (QUOTE cargo]
		  (EQ (GetValue self (QUOTE prevGoal))
		      (GetValue self (QUOTE goal)))
		  (GetValue has (QUOTE status))
		  (GetValue self (QUOTE destination))
		  (GREATERP (GetValue (GetValue self (QUOTE destination))
				      (QUOTE qty))
			    0))
	      (SETQ ↑value (PROGN)))
	    [[AND (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]
	    ((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 gameMaster (QUOTE timeRemaining))
		    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 gameMaster (QUOTE timeRemaining))
		    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)
          [COND
	    ((ISA (GetValue (GetValue self (QUOTE truck))
			    (QUOTE location))
		  ($ GasStation))
	      (SETQ ↑value (← self PurchaseGas]
          (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 "UVSC@EO=")))
			      (PutAuditRec self (QUOTE prevGoal)
					   (GetValue self (QUOTE goal))
					   ↑auditRecord)))
          (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])
)
(DECLARE: DONTCOPY
  (FILEMAP (NIL (47328 61543 (AtCurrentStopPlanner 47338 . 48377) (BuyGasPlanner 48379 . 48852) (
BuyPlanner 48854 . 49543) (CarryOutGoalPlanner 49545 . 50316) (FindStoppingPlacePlannerRules 50318 . 
53192) (GetClosePlanner 53194 . 53823) (GoToAlicePlanner 53825 . 54404) (GoToStoppingPlacePlannerRules
 54406 . 55000) (LeaveAlicePlanner 55002 . 55338) (PurchaseGasPlanner 55340 . 56201) (RateDumpsPlanner
 56203 . 57069) (RateGasStationsPlannerRules 57071 . 57435) (SellPlanner 57437 . 58481) (
SetGoalPlanner 58483 . 60222) (SitTightPlanner 60224 . 60394) (TakeTurnPlannerRules 60396 . 61541))))
)
STOP