(FILECREATED "27-JUL-83 16:35:37" {INDIGO}<LOOPS>TRUCKIN>MULTI>HOUSEPLAYER.;3 88976  

      changes to:  (FNS MaxPurchaseHousePlayerRules TakeTurnHousePlannerRules 
			RateProducersHousePlannerRules)

      previous date: "26-JUL-83 16:51:48" {INDIGO}<LOOPS>TRUCKIN>MULTI>HOUSEPLAYER.;2)


(PRETTYCOMPRINT HOUSEPLAYERCOMS)

(RPAQQ HOUSEPLAYERCOMS ((INSTANCES FindStoppingPlaceHousePlannerRules 
				   FindStoppingPlaceHousePlayerRules 
				   GoToStoppingPlaceHousePlannerRules 
				   GoToStoppingPlaceHousePlayerRules HPRateConsumers 
				   HPRateGasStations HPRateProducers MaxPurchaseHousePlayerRules 
				   RateConsumersHousePlannerRules RateGasStationsHousePlannerRules 
				   RateProducersHousePlannerRules RateSpotsNearAlicesHousePlayerRules 
				   SellGoodsHousePlayerRules SetGoalHousePlannerRules 
				   TakeTurnHousePlannerRules TakeTurnHousePlayerRules 
				   UnionHallHousePlanner)
	(CLASSES HousePlanner HousePlayer)
	(FNS FindStoppingPlaceHousePlannerRules FindStoppingPlaceHousePlayerRules 
	     GoToStoppingPlaceHousePlannerRules GoToStoppingPlaceHousePlayerRules HPRateConsumers 
	     HPRateGasStations HPRateProducers MaxPurchaseHousePlayerRules 
	     RateConsumersHousePlannerRules RateGasStationsHousePlannerRules 
	     RateProducersHousePlannerRules RateSpotsNearAlicesHousePlayerRules 
	     SellGoodsHousePlayerRules SetGoalHousePlannerRules TakeTurnHousePlannerRules 
	     TakeTurnHousePlayerRules UnionHallHousePlanner)))
(DEFINST RuleSet (FindStoppingPlaceHousePlannerRules "LZS.0.5349.129.33698.29")
	 (perspectiveNode #&(RuleSetNode "LZS.0.5349.129.33698.56") myViewName RuleSet)
	 (name #(FindStoppingPlaceHousePlannerRules NIL RememberName))
	 (compiledRules FindStoppingPlaceHousePlannerRules)
	 (workSpace HousePlanner)
	 (args NIL)
	 (tempVars (wStation gasStation has roughRd))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 6)
	 (controlStructure DO1)
	 (whileCondition NIL)
	 (compilerOptions (A))
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass))



(DEFINST RuleSet (FindStoppingPlaceHousePlayerRules "YSSC@<>`")
	 (perspectiveNode #&(RuleSetNode "YSSC@<>r") myViewName RuleSet)
	 (name #(FindStoppingPlaceHousePlayerRules NIL RememberName))
	 (compiledRules FindStoppingPlaceHousePlayerRules)
	 (workSpace HousePlayer)
	 (args NIL)
	 (tempVars (wStation gasStation))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 5)
	 (controlStructure DO1)
	 (whileCondition NIL)
	 (compilerOptions (A))
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass)
	 (arguments))



(DEFINST RuleSet (GoToStoppingPlaceHousePlannerRules "LZS.0.5349.129.33698.197")
	 (perspectiveNode #&(RuleSetNode "LZS.0.5349.129.33698.198") myViewName RuleSet)
	 (name #(GoToStoppingPlaceHousePlannerRules NIL RememberName))
	 (compiledRules GoToStoppingPlaceHousePlannerRules)
	 (workSpace HousePlanner)
	 (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 (GoToStoppingPlaceHousePlayerRules "YWSC@8@L")
	 (perspectiveNode #&(RuleSetNode "YWSC@8@S") myViewName RuleSet)
	 (name #(GoToStoppingPlaceHousePlayerRules NIL RememberName))
	 (compiledRules GoToStoppingPlaceHousePlayerRules)
	 (workSpace HousePlayer)
	 (args NIL)
	 (tempVars (realLocation numBuy))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 8)
	 (controlStructure DOALL)
	 (whileCondition NIL)
	 (compilerOptions (A))
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass)
	 (arguments))



(DEFINST RuleSet (HPRateConsumers "YWSC@8@p")
	 (perspectiveNode #&(RuleSetNode "YWSC@8AO") myViewName RuleSet)
	 (name #(HPRateConsumers NIL RememberName))
	 (compiledRules HPRateConsumers)
	 (workSpace HousePlayer)
	 (args (rs))
	 (tempVars (rating cargo))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 9)
	 (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 (HPRateProducers "YWSC@8@h")
	 (perspectiveNode #&(RuleSetNode "YWSC@8AP") myViewName RuleSet)
	 (name #(HPRateProducers NIL RememberName))
	 (compiledRules HPRateProducers)
	 (workSpace HousePlayer)
	 (args (rs))
	 (tempVars (rating maxBuy))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 12)
	 (controlStructure DOALL)
	 (whileCondition NIL)
	 (compilerOptions NIL)
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass)
	 (arguments))



(DEFINST RuleSet (MaxPurchaseHousePlayerRules "UVSC@ENE")
	 (perspectiveNode #&(RuleSetNode "UVSC@ENn") myViewName RuleSet)
	 (name #(MaxPurchaseHousePlayerRules NIL RememberName))
	 (compiledRules MaxPurchaseHousePlayerRules)
	 (workSpace HousePlayer)
	 (args (roadStop))
	 (tempVars (volumeCapacity weightCapacity volumeLimit weightLimit cashLimit producerLimit 
				   numBuy cashCapacity))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 3)
	 (controlStructure DOALL)
	 (whileCondition NIL)
	 (compilerOptions (A))
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass))



(DEFINST RuleSet (RateConsumersHousePlannerRules "LZS.0.5349.129.33698.21")
	 (perspectiveNode #&(RuleSetNode "LZS.0.5349.129.33698.57") myViewName RuleSet)
	 (name #(RateConsumersHousePlannerRules NIL RememberName))
	 (compiledRules RateConsumersHousePlannerRules)
	 (workSpace HousePlanner)
	 (args (rs))
	 (tempVars (rating cargo))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 6)
	 (controlStructure DOALL)
	 (whileCondition NIL)
	 (compilerOptions (A))
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass))



(DEFINST RuleSet (RateGasStationsHousePlannerRules "LZS.0.5349.129.33698.22")
	 (perspectiveNode #&(RuleSetNode "LZS.0.5349.129.33698.58") myViewName RuleSet)
	 (name #(RateGasStationsHousePlannerRules NIL RememberName))
	 (compiledRules RateGasStationsHousePlannerRules)
	 (workSpace HousePlanner)
	 (args (rs))
	 (tempVars (rating))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 6)
	 (controlStructure DOALL)
	 (whileCondition NIL)
	 (compilerOptions (A))
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass))



(DEFINST RuleSet (RateProducersHousePlannerRules "LZS.0.5349.129.33698.20")
	 (perspectiveNode #&(RuleSetNode "LZS.0.5349.129.33698.59") myViewName RuleSet)
	 (name #(RateProducersHousePlannerRules NIL RememberName))
	 (compiledRules RateProducersHousePlannerRules)
	 (workSpace HousePlanner)
	 (args (rs))
	 (tempVars (rating maxBuy))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 10)
	 (controlStructure DOALL)
	 (whileCondition NIL)
	 (compilerOptions NIL)
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass))



(DEFINST RuleSet (RateSpotsNearAlicesHousePlayerRules "UVSC@END")
	 (perspectiveNode #&(RuleSetNode "UVSC@ENo") myViewName RuleSet)
	 (name #(RateSpotsNearAlicesHousePlayerRules NIL RememberName))
	 (compiledRules RateSpotsNearAlicesHousePlayerRules)
	 (workSpace HousePlayer)
	 (args (roadStop))
	 (tempVars (rating cargo))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 6)
	 (controlStructure DOALL)
	 (whileCondition NIL)
	 (compilerOptions NIL)
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass))



(DEFINST RuleSet (SellGoodsHousePlayerRules "YWSC@8@x")
	 (perspectiveNode #&(RuleSetNode "YWSC@8AQ") myViewName RuleSet)
	 (name #(SellGoodsHousePlayerRules NIL RememberName))
	 (compiledRules SellGoodsHousePlayerRules)
	 (workSpace HousePlayer)
	 (args NIL)
	 (tempVars (cargo sellQty))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 5)
	 (controlStructure DOALL)
	 (whileCondition NIL)
	 (compilerOptions (A))
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass)
	 (arguments))



(DEFINST RuleSet (SetGoalHousePlannerRules "LZS.0.5349.129.33698.54")
	 (perspectiveNode #&(RuleSetNode "LZS.0.5349.129.33698.60") myViewName RuleSet)
	 (name #(SetGoalHousePlannerRules NIL RememberName))
	 (compiledRules SetGoalHousePlannerRules)
	 (workSpace HousePlanner)
	 (args NIL)
	 (tempVars NIL)
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 10)
	 (controlStructure DO1)
	 (whileCondition NIL)
	 (compilerOptions NIL)
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass))



(DEFINST RuleSet (TakeTurnHousePlannerRules "LZS.0.5349.129.33698.46")
	 (perspectiveNode #&(RuleSetNode "LZS.0.5349.129.33698.61") myViewName RuleSet)
	 (name #(TakeTurnHousePlannerRules NIL RememberName))
	 (compiledRules TakeTurnHousePlannerRules)
	 (workSpace HousePlanner)
	 (args NIL)
	 (tempVars (possibleStops))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 4)
	 (controlStructure DOALL)
	 (whileCondition ((:(\ LispVar Communicator)
			    gameStarted)))
	 (compilerOptions (A))
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass))



(DEFINST RuleSet (TakeTurnHousePlayerRules "YSSC@<>")
	 (perspectiveNode #&(RuleSetNode "YSSC@<↑") myViewName RuleSet)
	 (name #(TakeTurnHousePlayerRules NIL RememberName))
	 (compiledRules TakeTurnHousePlayerRules)
	 (workSpace HousePlayer)
	 (args NIL)
	 (tempVars (possibleStops gasStation))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 9)
	 (controlStructure DOALL)
	 (whileCondition NIL)
	 (compilerOptions (A))
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass)
	 (arguments))



(DEFINST RuleSet (UnionHallHousePlanner "LZS.0.5349.129.33698.55")
	 (perspectiveNode #&(RuleSetNode "LZS.0.5349.129.33698.62"))
	 (name #(UnionHallHousePlanner NIL RememberName))
	 (compiledRules UnionHallHousePlanner)
	 (workSpace HousePlanner)
	 (args NIL)
	 (tempVars NIL)
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 1)
	 (controlStructure DO1)
	 (whileCondition NIL)
	 (compilerOptions NIL)
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass))



(DEFINST RuleSetNode ("LZS.0.5349.129.33698.56")
	 (perspectives ? RuleSet #&(RuleSet "LZS.0.5349.129.33698.29") Source 
		       #&(RuleSetSource "LZS.0.5349.129.33698.63")))



(DEFINST RuleSetNode ("YSSC@<>r")
	 (perspectives ? RuleSet #&(RuleSet "YSSC@<>`") Source #&(RuleSetSource "YSSC@<>t")))



(DEFINST RuleSetNode ("LZS.0.5349.129.33698.198")
	 (perspectives ? RuleSet #&(RuleSet "LZS.0.5349.129.33698.197") Source 
		       #&(RuleSetSource "LZS.0.5349.129.33698.199")))



(DEFINST RuleSetNode ("YWSC@8@S")
	 (perspectives ? RuleSet #&(RuleSet "YWSC@8@L") Source #&(RuleSetSource "YWSC@8@T")))



(DEFINST RuleSetNode ("YWSC@8AO")
	 (perspectives ? RuleSet #&(RuleSet "YWSC@8@p") Source #&(RuleSetSource "YWSC@8AR")))



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



(DEFINST RuleSetNode ("YWSC@8AP")
	 (perspectives ? RuleSet #&(RuleSet "YWSC@8@h") Source #&(RuleSetSource "YWSC@8AS")))



(DEFINST RuleSetNode ("UVSC@ENn")
	 (perspectives ? RuleSet #&(RuleSet "UVSC@ENE") Source #&(RuleSetSource "UVSC@ENp")))



(DEFINST RuleSetNode ("LZS.0.5349.129.33698.57")
	 (perspectives ? RuleSet #&(RuleSet "LZS.0.5349.129.33698.21") Source 
		       #&(RuleSetSource "LZS.0.5349.129.33698.64")))



(DEFINST RuleSetNode ("LZS.0.5349.129.33698.58")
	 (perspectives ? RuleSet #&(RuleSet "LZS.0.5349.129.33698.22") Source 
		       #&(RuleSetSource "LZS.0.5349.129.33698.65")))



(DEFINST RuleSetNode ("LZS.0.5349.129.33698.59")
	 (perspectives ? RuleSet #&(RuleSet "LZS.0.5349.129.33698.20") Source 
		       #&(RuleSetSource "LZS.0.5349.129.33698.66")))



(DEFINST RuleSetNode ("UVSC@ENo")
	 (perspectives ? RuleSet #&(RuleSet "UVSC@END") Source #&(RuleSetSource "UVSC@ENq")))



(DEFINST RuleSetNode ("YWSC@8AQ")
	 (perspectives ? RuleSet #&(RuleSet "YWSC@8@x") Source #&(RuleSetSource "YWSC@8AT")))



(DEFINST RuleSetNode ("LZS.0.5349.129.33698.60")
	 (perspectives ? RuleSet #&(RuleSet "LZS.0.5349.129.33698.54") Source 
		       #&(RuleSetSource "LZS.0.5349.129.33698.67")))



(DEFINST RuleSetNode ("LZS.0.5349.129.33698.61")
	 (perspectives ? RuleSet #&(RuleSet "LZS.0.5349.129.33698.46") Source 
		       #&(RuleSetSource "LZS.0.5349.129.33698.68")))



(DEFINST RuleSetNode ("YSSC@<↑")
	 (perspectives ? RuleSet #&(RuleSet "YSSC@<>") Source #&(RuleSetSource "YSSC@<←")))



(DEFINST RuleSetNode ("LZS.0.5349.129.33698.62")
	 (perspectives ? RuleSet #&(RuleSet "LZS.0.5349.129.33698.55") Source 
		       #&(RuleSetSource "LZS.0.5349.129.33698.69")))



(DEFINST RuleSetSource ("LZS.0.5349.129.33698.63")
	 (indexedVars ((#&(Rule "LZS.0.5349.129.33698.48"))
		       (#&(Rule "LZS.0.5349.129.33698.49"))
		       (#&(Rule "LZS.0.5349.129.33698.50"))
		       (#&(Rule "LZS.0.5349.129.33698.51"))
		       (#&(Rule "LZS.0.5349.129.33698.52"))
		       (#&(Rule "LZS.0.5349.129.33698.53"))))
	 (perspectiveNode #&(RuleSetNode "LZS.0.5349.129.33698.56") myViewName Source)
	 (created " 1-FEB-83 14:25:23")
	 (creator LOOPSCOURSE)
	 (edited "26-JUL-83 13:56:35")
	 (editor MITTAL))



(DEFINST RuleSetSource ("YSSC@<>t")
	 (indexedVars ((#&(Rule "LZS.0.5349.129.33698.70"))
		       (#&(Rule "LZS.0.5349.129.33698.71"))
		       (#&(Rule "LZS.0.5349.129.33698.72"))
		       (#&(Rule "LZS.0.5349.129.33698.73"))
		       (#&(Rule "LZS.0.5349.129.33698.74"))))
	 (perspectiveNode #&(RuleSetNode "YSSC@<>r") myViewName Source)
	 (created " 1-FEB-83 14:25:23")
	 (creator LOOPSCOURSE)
	 (edited "26-JUL-83 13:30:23")
	 (editor MITTAL))



(DEFINST RuleSetSource ("LZS.0.5349.129.33698.199")
	 (indexedVars ((#&(Rule "LZS.0.5349.129.33698.200"))
		       (#&(Rule "LZS.0.5349.129.33698.201"))
		       (#&(Rule "LZS.0.5349.129.33698.202"))))
	 (perspectiveNode #&(RuleSetNode "LZS.0.5349.129.33698.198") myViewName Source)
	 (created " 1-FEB-83 14:25:34")
	 (creator LOOPSCOURSE)
	 (edited "26-JUL-83 16:45:19")
	 (editor MITTAL))



(DEFINST RuleSetSource ("YWSC@8@T")
	 (indexedVars ((#&(Rule "LZS.0.5349.129.33698.16"))
		       (#&(Rule "LZS.0.5349.129.33698.75"))
		       (#&(Rule "LZS.0.5349.129.33698.76"))
		       (#&(Rule "LZS.0.5349.129.33698.77"))
		       (#&(Rule "LZS.0.5349.129.33698.17"))
		       (#&(Rule "LZS.0.5349.129.33698.78"))
		       (#&(Rule "LZS.0.5349.129.33698.79"))
		       (#&(Rule "LZS.0.5349.129.33698.18"))))
	 (perspectiveNode #&(RuleSetNode "YWSC@8@S") myViewName Source)
	 (created " 1-FEB-83 14:25:34")
	 (creator LOOPSCOURSE)
	 (edited "26-JUL-83 13:18:32")
	 (editor MITTAL))



(DEFINST RuleSetSource ("YWSC@8AR")
	 (indexedVars ((#&(Rule "LZS.0.5349.129.33698.80"))
		       (#&(Rule "LZS.0.5349.129.33698.81"))
		       (#&(Rule "LZS.0.5349.129.33698.82"))
		       (#&(Rule "LZS.0.5349.129.33698.83"))
		       (#&(Rule "LZS.0.5349.129.33698.84"))
		       (#&(Rule "LZS.0.5349.129.33698.85"))
		       (#&(Rule "LZS.0.5349.129.33698.86"))
		       (#&(Rule "LZS.0.5349.129.33698.87"))
		       (#&(Rule "LZS.0.5349.129.33698.88"))))
	 (perspectiveNode #&(RuleSetNode "YWSC@8AO") myViewName Source)
	 (created "18-FEB-83 22:45:14")
	 (creator STEFIK)
	 (edited "26-JUL-83 13:24:46")
	 (editor MITTAL))



(DEFINST RuleSetSource ("YSSC@<>u")
	 (indexedVars ((#&(Rule "LZS.0.5349.129.33698.89"))
		       (#&(Rule "LZS.0.5349.129.33698.90"))
		       (#&(Rule "LZS.0.5349.129.33698.91"))
		       (#&(Rule "LZS.0.5349.129.33698.92"))
		       (#&(Rule "LZS.0.5349.129.33698.93"))
		       (#&(Rule "LZS.0.5349.129.33698.94"))))
	 (perspectiveNode #&(RuleSetNode "YSSC@<>s") myViewName Source)
	 (created "19-MAY-83 17:26:44")
	 (creator MITTAL)
	 (edited "26-JUL-83 13:25:00")
	 (editor MITTAL))



(DEFINST RuleSetSource ("YWSC@8AS")
	 (indexedVars ((#&(Rule "LZS.0.5349.129.33698.95"))
		       (#&(Rule "LZS.0.5349.129.33698.96"))
		       (#&(Rule "LZS.0.5349.129.33698.97"))
		       (#&(Rule "LZS.0.5349.129.33698.98"))
		       (#&(Rule "LZS.0.5349.129.33698.99"))
		       (#&(Rule "LZS.0.5349.129.33698.100"))
		       (#&(Rule "LZS.0.5349.129.33698.101"))
		       (#&(Rule "LZS.0.5349.129.33698.102"))
		       (#&(Rule "LZS.0.5349.129.33698.103"))
		       (#&(Rule "LZS.0.5349.129.33698.104"))
		       (#&(Rule "LZS.0.5349.129.33698.105"))
		       (#&(Rule "LZS.0.5349.129.33698.106"))))
	 (perspectiveNode #&(RuleSetNode "YWSC@8AP") myViewName Source)
	 (created "18-FEB-83 22:45:14")
	 (creator STEFIK)
	 (edited "26-JUL-83 13:24:40")
	 (editor MITTAL))



(DEFINST RuleSetSource ("UVSC@ENp")
	 (indexedVars ((#&(Rule "L[S.0.5349.120.41796.18"))
		       (#&(Rule "L[S.0.5349.120.41796.19"))
		       (#&(Rule "L[S.0.5349.120.41796.20"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@ENn") myViewName Source)
	 (created " 1-FEB-83 14:25:11")
	 (creator LOOPSCOURSE)
	 (edited "27-JUL-83 11:44:45")
	 (editor MITTAL))



(DEFINST RuleSetSource ("LZS.0.5349.129.33698.64")
	 (indexedVars ((#&(Rule "LZS.0.5349.129.33698.107"))
		       (#&(Rule "LZS.0.5349.129.33698.108"))
		       (#&(Rule "LZS.0.5349.129.33698.109"))
		       (#&(Rule "LZS.0.5349.129.33698.110"))
		       (#&(Rule "LZS.0.5349.129.33698.111"))
		       (#&(Rule "LZS.0.5349.129.33698.112"))))
	 (perspectiveNode #&(RuleSetNode "LZS.0.5349.129.33698.57") myViewName Source)
	 (created "18-FEB-83 22:45:14")
	 (creator STEFIK)
	 (edited "26-JUL-83 14:22:31")
	 (editor MITTAL))



(DEFINST RuleSetSource ("LZS.0.5349.129.33698.65")
	 (indexedVars ((#&(Rule "LZS.0.5349.129.33698.113"))
		       (#&(Rule "LZS.0.5349.129.33698.114"))
		       (#&(Rule "LZS.0.5349.129.33698.115"))
		       (#&(Rule "LZS.0.5349.129.33698.116"))
		       (#&(Rule "LZS.0.5349.129.33698.117"))
		       (#&(Rule "LZS.0.5349.129.33698.118"))))
	 (perspectiveNode #&(RuleSetNode "LZS.0.5349.129.33698.58") myViewName Source)
	 (created "19-MAY-83 17:26:44")
	 (creator MITTAL)
	 (edited "26-JUL-83 13:20:12")
	 (editor MITTAL))



(DEFINST RuleSetSource ("LZS.0.5349.129.33698.66")
	 (indexedVars ((#&(Rule "L[S.0.5349.120.41796.21"))
		       (#&(Rule "L[S.0.5349.120.41796.22"))
		       (#&(Rule "L[S.0.5349.120.41796.23"))
		       (#&(Rule "L[S.0.5349.120.41796.24"))
		       (#&(Rule "L[S.0.5349.120.41796.25"))
		       (#&(Rule "L[S.0.5349.120.41796.26"))
		       (#&(Rule "L[S.0.5349.120.41796.27"))
		       (#&(Rule "L[S.0.5349.120.41796.28"))
		       (#&(Rule "L[S.0.5349.120.41796.29"))
		       (#&(Rule "L[S.0.5349.120.41796.30"))))
	 (perspectiveNode #&(RuleSetNode "LZS.0.5349.129.33698.59") myViewName Source)
	 (created "18-FEB-83 22:45:14")
	 (creator STEFIK)
	 (edited "27-JUL-83 16:33:34")
	 (editor MITTAL))



(DEFINST RuleSetSource ("UVSC@ENq")
	 (indexedVars ((#&(Rule "LZS.0.5349.129.33698.129"))
		       (#&(Rule "LZS.0.5349.129.33698.130"))
		       (#&(Rule "LZS.0.5349.129.33698.131"))
		       (#&(Rule "LZS.0.5349.129.33698.132"))
		       (#&(Rule "LZS.0.5349.129.33698.133"))
		       (#&(Rule "LZS.0.5349.129.33698.134"))))
	 (perspectiveNode #&(RuleSetNode "UVSC@ENo") myViewName Source)
	 (created "18-FEB-83 20:41:23")
	 (creator STEFIK)
	 (edited "26-JUL-83 13:21:20")
	 (editor MITTAL))



(DEFINST RuleSetSource ("YWSC@8AT")
	 (indexedVars ((#&(Rule "LZS.0.5349.129.33698.203"))
		       (#&(Rule "LZS.0.5349.129.33698.204"))
		       (#&(Rule "LZS.0.5349.129.33698.205"))
		       (#&(Rule "LZS.0.5349.129.33698.206"))
		       (#&(Rule "LZS.0.5349.129.33698.188"))))
	 (perspectiveNode #&(RuleSetNode "YWSC@8AQ") myViewName Source)
	 (created " 1-FEB-83 14:25:40")
	 (creator LOOPSCOURSE)
	 (edited "26-JUL-83 16:08:28")
	 (editor MITTAL))



(DEFINST RuleSetSource ("LZS.0.5349.129.33698.67")
	 (indexedVars ((#&(Rule "LZS.0.5349.129.33698.139"))
		       (#&(Rule "LZS.0.5349.129.33698.140"))
		       (#&(Rule "LZS.0.5349.129.33698.141"))
		       (#&(Rule "LZS.0.5349.129.33698.142"))
		       (#&(Rule "LZS.0.5349.129.33698.143"))
		       (#&(Rule "LZS.0.5349.129.33698.144"))
		       (#&(Rule "LZS.0.5349.129.33698.145"))
		       (#&(Rule "LZS.0.5349.129.33698.146"))
		       (#&(Rule "LZS.0.5349.129.33698.147"))
		       (#&(Rule "LZS.0.5349.129.33698.148"))))
	 (perspectiveNode #&(RuleSetNode "LZS.0.5349.129.33698.60") myViewName Source)
	 (created "22-JUN-83 15:37:14")
	 (creator MITTAL)
	 (edited "26-JUL-83 14:17:11")
	 (editor MITTAL))



(DEFINST RuleSetSource ("LZS.0.5349.129.33698.68")
	 (indexedVars ((#&(Rule "L[S.0.5349.120.41796.31"))
		       (#&(Rule "L[S.0.5349.120.41796.32"))
		       (#&(Rule "L[S.0.5349.120.41796.17"))
		       (#&(Rule "L[S.0.5349.120.41796.33"))))
	 (perspectiveNode #&(RuleSetNode "LZS.0.5349.129.33698.61") myViewName Source)
	 (created " 1-FEB-83 14:25:51")
	 (creator LOOPSCOURSE)
	 (edited "27-JUL-83 16:30:47")
	 (editor MITTAL))



(DEFINST RuleSetSource ("YSSC@<←")
	 (indexedVars ((#&(Rule "LZS.0.5349.129.33698.2"))
		       (#&(Rule "LZS.0.5349.129.33698.3"))
		       (#&(Rule "LZS.0.5349.129.33698.4"))
		       (#&(Rule "LZS.0.5349.129.33698.5"))
		       (#&(Rule "LZS.0.5349.129.33698.6"))
		       (#&(Rule "LZS.0.5349.129.33698.7"))
		       (#&(Rule "LZS.0.5349.129.33698.8"))
		       (#&(Rule "LZS.0.5349.129.33698.9"))
		       (#&(Rule "LZS.0.5349.129.33698.152"))))
	 (perspectiveNode #&(RuleSetNode "YSSC@<↑") myViewName Source)
	 (created " 1-FEB-83 14:25:51")
	 (creator LOOPSCOURSE)
	 (edited "26-JUL-83 13:14:32")
	 (editor MITTAL))



(DEFINST RuleSetSource ("LZS.0.5349.129.33698.69")
	 (indexedVars ((#&(Rule "LZS.0.5349.129.33698.153"))))
	 (perspectiveNode #&(RuleSetNode "LZS.0.5349.129.33698.62"))
	 (created "26-JUL-83 14:17:26")
	 (creator MITTAL)
	 (edited "26-JUL-83 14:18:34")
	 (editor MITTAL))



(DEFINST Rule ("LZS.0.5349.129.33698.48")
	 (source 

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

(* If already at destination, make it be stoppingPlace)
IF truck:location=destination
THEN stoppingPlace←destination;")
	 (edited "26-JUL-83 13:56:35")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.29")))



(DEFINST Rule ("LZS.0.5349.129.33698.49")
	 (source 

"(* Obey the law - stop at WeighStations.)
IF truck:cargo
   wStation←(NearestRoadStop (RoadStops $WeighStation horizon direction 'Room))
   (Distance wStation)<(Distance destination) 
THEN stoppingPlace←wStation;")
	 (edited "26-JUL-83 13:56:35")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.29")))



(DEFINST Rule ("LZS.0.5349.129.33698.50")
	 (source 

"(* check if fragile cargo)
IF truck:cargo has←(CAR truck:cargo) (ISA has $FragileCommodity)
   roughRd←(NearestRoadStop (RoadStops $RoughRoad horizon direction 'Room))
   (Distance roughRd)<(Distance destination)
THEN stoppingPlace←roughRd;")
	 (edited "26-JUL-83 13:56:35")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.29")))



(DEFINST Rule ("LZS.0.5349.129.33698.51")
	 (source 
   "IF (Distance destination)<=.Range1 (RoomToParkP destination)
THEN stoppingPlace←destination;")
	 (edited "26-JUL-83 13:56:35")
	 (editor MITTAL)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.29")))



(DEFINST Rule ("LZS.0.5349.129.33698.52")
	 (source 

"IF goal~='GoToAlices
   truck:fuel < .6 * truck::MaxFuel
   gasStation←(FurthestRoadStop (RoadStops $GasStation horizon direction 'Room))
   gasStation:qty>0
THEN stoppingPlace←gasStation;")
	 (edited "26-JUL-83 13:56:35")
	 (editor MITTAL)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.29")))



(DEFINST Rule ("LZS.0.5349.129.33698.53")
	 (source "THEN stoppingPlace←(NthRoadStop  horizon direction NIL 'Room);")
	 (edited "26-JUL-83 13:56:35")
	 (editor MITTAL)
	 (ruleNumber 6)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.29")))



(DEFINST Rule ("LZS.0.5349.129.33698.70")
	 (source 

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

(* If already at destination, make it be stoppingPlace)
IF truck:location=destination
THEN stoppingPlace←destination;")
	 (edited "26-JUL-83 13:30:23")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "YSSC@<>`")))



(DEFINST Rule ("LZS.0.5349.129.33698.71")
	 (source 

"(* Obey the law - stop at WeighStations.)
IF truck:cargo
   wStation←(NearestRoadStop (RoadStops $WeighStation .Range1 direction 'Room))
   (Distance wStation)<(Distance destination) 
THEN stoppingPlace←wStation;")
	 (edited "26-JUL-83 13:30:23")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "YSSC@<>`")))



(DEFINST Rule ("LZS.0.5349.129.33698.72")
	 (source 
   "IF (Distance destination)<=.Range1 (RoomToParkP destination)
THEN stoppingPlace←destination;")
	 (edited "26-JUL-83 13:30:23")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "YSSC@<>`")))



(DEFINST Rule ("LZS.0.5349.129.33698.73")
	 (source 

"IF goal~='GoToAlices
   truck:fuel < .6 * truck::MaxFuel
   gasStation←(FurthestRoadStop (RoadStops $GasStation .Range1 direction 'Room))
   gasStation:qty>0
THEN stoppingPlace←gasStation;")
	 (edited "26-JUL-83 13:30:23")
	 (editor MITTAL)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "YSSC@<>`")))



(DEFINST Rule ("LZS.0.5349.129.33698.74")
	 (source 

"THEN stoppingPlace←(NthRoadStop  (IMIN .Range1  (Distance destination))
                                 direction NIL 'Room);")
	 (edited "26-JUL-83 13:30:23")
	 (editor MITTAL)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "YSSC@<>`")))



(DEFINST Rule ("LZS.0.5349.129.33698.200")
	 (source 

"(* Go to the stoppingPlace)
IF stoppingPlace=truck:location
 THEN (WriteGameStatus %"Hm! %" driver %" already there%");")
	 (edited "26-JUL-83 16:45:19")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.197")))



(DEFINST Rule ("LZS.0.5349.129.33698.201")
	 (source 

"IF stoppingPlace.BanditP
 THEN (WriteGameStatus  driver %" Not moving because of bandits%")
      (← \PlayerInterface Move self truck:location);")
	 (edited "26-JUL-83 16:45:19")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.197")))



(DEFINST Rule ("LZS.0.5349.129.33698.202")
	 (source "-> (← \PlayerInterface Move self stoppingPlace);")
	 (edited "26-JUL-83 16:45:19")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.197")))



(DEFINST Rule ("LZS.0.5349.129.33698.16")
	 (source "	THEN direction← (DirectionOf destination);")
	 (edited "26-JUL-83 13:18:32")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "YWSC@8@L")))



(DEFINST Rule ("LZS.0.5349.129.33698.75")
	 (source "        -> realLocation←truck:location;")
	 (edited "26-JUL-83 13:18:32")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "YWSC@8@L")))



(DEFINST Rule ("LZS.0.5349.129.33698.76")
	 (source 

"	IF .FindStoppingPlace stoppingPlace~=truck:location
           ~stoppingPlace.BanditP
	THEN (← \PlayerInterface Move self stoppingPlace) 
               realLocation←truck:location;")
	 (edited "26-JUL-83 13:18:32")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "YWSC@8@L")))



(DEFINST Rule ("LZS.0.5349.129.33698.77")
	 (source 

"        IF realLocation~=stoppingPlace 
	THEN (WriteGameStatus %"Oh!! %" driver %" didnt go to stoppingPlace%");")
	 (edited "26-JUL-83 13:18:32")
	 (editor MITTAL)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "YWSC@8@L")))



(DEFINST Rule ("LZS.0.5349.129.33698.17")
	 (source 

"	IF (ISA realLocation $GasStation) realLocation:qty > 0
	THEN .BuyGas goal←'Peddle destination←NIL (STOP 'Peddle NIL 'BoughtGas);")
	 (edited "26-JUL-83 13:18:32")
	 (editor MITTAL)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "YWSC@8@L")))



(DEFINST Rule ("LZS.0.5349.129.33698.78")
	 (source 

"	IF (ISA realLocation $Producer) 
           goal='Peddle
	   realLocation=destination 
           numBuy←(← self MaxPurchase realLocation)
           numBuy>=1  
	THEN (← \PlayerInterface Buy self numBuy);")
	 (edited "26-JUL-83 13:18:32")
	 (editor MITTAL)
	 (ruleNumber 6)
	 (ruleSet #&(RuleSet "YWSC@8@L")))



(DEFINST Rule ("LZS.0.5349.129.33698.79")
	 (source "	IF (ISA realLocation $Consumer) truck:cargo
	THEN .SellGoods;")
	 (edited "26-JUL-83 13:18:32")
	 (editor MITTAL)
	 (ruleNumber 7)
	 (ruleSet #&(RuleSet "YWSC@8@L")))



(DEFINST Rule ("LZS.0.5349.129.33698.18")
	 (source "        IF realLocation=destination
         THEN destination←NIL;")
	 (edited "26-JUL-83 13:18:32")
	 (editor MITTAL)
	 (ruleNumber 8)
	 (ruleSet #&(RuleSet "YWSC@8@L")))



(DEFINST Rule ("LZS.0.5349.129.33698.80")
	 (source 
      "	(* Rate the suitability of a proposed Consumer.)

-> cargo ← (CAR truck:cargo) rating←0;")
	 (edited "26-JUL-83 13:24:46")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "YWSC@8@p")))



(DEFINST Rule ("LZS.0.5349.129.33698.81")
	 (source 

"(* if spoilt go to CityDump)
IF ~cargo:status (ISA rs $CityDump) 
THEN (STOP 5000 'CityDump 'LookNoMore);")
	 (edited "26-JUL-83 13:24:46")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "YWSC@8@p")))



(DEFINST Rule ("LZS.0.5349.129.33698.82")
	 (source "IF ~cargo:status
THEN (STOP NIL 'SpoiltGoods 'CannotSell);")
	 (edited "26-JUL-83 13:24:46")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "YWSC@8@p")))



(DEFINST Rule ("LZS.0.5349.129.33698.83")
	 (source 

"(* Consumer must want current cargo.)
 IF ~(ISA cargo rs::Commodity)
  THEN (STOP -10000 NIL 'CannotSellHere);")
	 (edited "26-JUL-83 13:24:46")
	 (editor MITTAL)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "YWSC@8@p")))



(DEFINST Rule ("LZS.0.5349.129.33698.84")
	 (source 

"(* Exclude consumers that have full inventory.)
 IF rs:qty < 1
  THEN (STOP -10000 NIL 'CannotSellHere);")
	 (edited "26-JUL-83 13:24:46")
	 (editor MITTAL)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "YWSC@8@p")))



(DEFINST Rule ("LZS.0.5349.129.33698.85")
	 (source "(* Need to be able to park)
 IF ~(RoomToParkP rs)
  THEN rating ← rating - 200;")
	 (edited "26-JUL-83 13:24:46")
	 (editor MITTAL)
	 (ruleNumber 6)
	 (ruleSet #&(RuleSet "YWSC@8@p")))



(DEFINST Rule ("LZS.0.5349.129.33698.86")
	 (source "(* Dont go if Bandits)
IF rs.BanditP
 THEN rating ← rating - 10000;")
	 (edited "26-JUL-83 13:24:46")
	 (editor MITTAL)
	 (ruleNumber 7)
	 (ruleSet #&(RuleSet "YWSC@8@p")))



(DEFINST Rule ("LZS.0.5349.129.33698.87")
	 (source "(* Favor high price ratios.)
  -> rating ← rating + 100 * rs:pr ;")
	 (edited "26-JUL-83 13:24:46")
	 (editor MITTAL)
	 (ruleNumber 8)
	 (ruleSet #&(RuleSet "YWSC@8@p")))



(DEFINST Rule ("LZS.0.5349.129.33698.88")
	 (source 
 "(* Favor close places.)
  -> rating ← rating - 5 * [truck::Gpm *(Distance rs truck:location)];")
	 (edited "26-JUL-83 13:24:46")
	 (editor MITTAL)
	 (ruleNumber 9)
	 (ruleSet #&(RuleSet "YWSC@8@p")))



(DEFINST Rule ("LZS.0.5349.129.33698.89")
	 (source "(* rate gas stations within range)
 THEN rating ← 0;")
	 (edited "26-JUL-83 13:25:00")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "YSSC@<>m")))



(DEFINST Rule ("LZS.0.5349.129.33698.90")
	 (source "IF rs:qty=0 
 THEN rating ← -2000;")
	 (edited "26-JUL-83 13:25:00")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "YSSC@<>m")))



(DEFINST Rule ("LZS.0.5349.129.33698.91")
	 (source "IF ~(RoomToParkP rs)
 THEN rating ← rating - 200;")
	 (edited "26-JUL-83 13:25:00")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "YSSC@<>m")))



(DEFINST Rule ("LZS.0.5349.129.33698.92")
	 (source "IF rs.BanditP
 THEN rating ← rating - 200;")
	 (edited "26-JUL-83 13:25:00")
	 (editor MITTAL)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "YSSC@<>m")))



(DEFINST Rule ("LZS.0.5349.129.33698.93")
	 (source " THEN rating ← rating - [10 * (Distance rs truck:location)];")
	 (edited "26-JUL-83 13:25:00")
	 (editor MITTAL)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "YSSC@<>m")))



(DEFINST Rule ("LZS.0.5349.129.33698.94")
	 (source " THEN rating ← rating + (IMIN rs:qty truck::MaxFuel);")
	 (edited "26-JUL-83 13:25:00")
	 (editor MITTAL)
	 (ruleNumber 6)
	 (ruleSet #&(RuleSet "YSSC@<>m")))



(DEFINST Rule ("LZS.0.5349.129.33698.95")
	 (source "	(* Rate the suitability of a proposed Producer.)
-> rating ← 0;")
	 (edited "26-JUL-83 13:24:40")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "YWSC@8@h")))



(DEFINST Rule ("LZS.0.5349.129.33698.96")
	 (source 
      "(* Exclude gas stations.)
 IF (ISA rs $GasStation)
  THEN (STOP -100000 NIL 'GasStation);")
	 (edited "26-JUL-83 13:24:40")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "YWSC@8@h")))



(DEFINST Rule ("LZS.0.5349.129.33698.97")
	 (source 
  "(* Exclude producers that are sold out.)
 IF rs:qty < 1
  THEN (STOP -100000 NIL 'CannotBuy);")
	 (edited "26-JUL-83 13:24:40")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "YWSC@8@h")))



(DEFINST Rule ("LZS.0.5349.129.33698.98")
	 (source 

"(* Penalize producers for which can buy < 1 items.)
 IF maxBuy←(← self MaxPurchase rs) 
    maxBuy < 1
  THEN (STOP -100000 NIL 'CannotBuy);")
	 (edited "26-JUL-83 13:24:40")
	 (editor MITTAL)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "YWSC@8@h")))



(DEFINST Rule ("LZS.0.5349.129.33698.99")
	 (source "(* Need to be able to park)
IF ~(RoomToParkP rs)
 THEN rating ← -500;")
	 (edited "26-JUL-83 13:24:40")
	 (editor MITTAL)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "YWSC@8@h")))



(DEFINST Rule ("LZS.0.5349.129.33698.100")
	 (source "(* If Bandits there, dont go)
IF rs.BanditP
THEN rating ← rating - 10000;")
	 (edited "26-JUL-83 13:24:40")
	 (editor MITTAL)
	 (ruleNumber 6)
	 (ruleSet #&(RuleSet "YWSC@8@h")))



(DEFINST Rule ("LZS.0.5349.129.33698.101")
	 (source 

"(* Exclude perishables.)
 IF (SUBCLASS rs::Commodity $PerishableCommodity)
  THEN rating ← rating - 2000 + [100 * rs::Commodity::MinLifetime];")
	 (edited "26-JUL-83 13:24:40")
	 (editor MITTAL)
	 (ruleNumber 7)
	 (ruleSet #&(RuleSet "YWSC@8@h")))



(DEFINST Rule ("LZS.0.5349.129.33698.102")
	 (source 

"(* Exclude excessively fragile goods.)
 IF (SUBCLASS rs::Commodity $FragileCommodity)  
  THEN rating ← rating - [100 * rs::Commodity::FragilityLevel];")
	 (edited "26-JUL-83 13:24:40")
	 (editor MITTAL)
	 (ruleNumber 8)
	 (ruleSet #&(RuleSet "YWSC@8@h")))



(DEFINST Rule ("LZS.0.5349.129.33698.103")
	 (source 
    "(* favor LuxuryGoods)
IF (SUBCLASS rs::Commodity $LuxuryGoods)
THEN rating ← rating + 1000;")
	 (edited "26-JUL-83 13:24:40")
	 (editor MITTAL)
	 (ruleNumber 9)
	 (ruleSet #&(RuleSet "YWSC@8@h")))



(DEFINST Rule ("LZS.0.5349.129.33698.104")
	 (source "IF (SUBCLASS rs::Commodity $Xerox1100)
THEN rating ← rating + 1000 ;")
	 (edited "26-JUL-83 13:24:40")
	 (editor MITTAL)
	 (ruleNumber 10)
	 (ruleSet #&(RuleSet "YWSC@8@h")))



(DEFINST Rule ("LZS.0.5349.129.33698.105")
	 (source "(* favor higher qty)
 -> rating ← rating + [20 * maxBuy];")
	 (edited "26-JUL-83 13:24:40")
	 (editor MITTAL)
	 (ruleNumber 11)
	 (ruleSet #&(RuleSet "YWSC@8@h")))



(DEFINST Rule ("LZS.0.5349.129.33698.106")
	 (source 
"(* Favor close places.)
  -> rating ← rating - [10 * truck::Gpm * (Distance rs truck:location)];")
	 (edited "26-JUL-83 13:24:40")
	 (editor MITTAL)
	 (ruleNumber 12)
	 (ruleSet #&(RuleSet "YWSC@8@h")))



(DEFINST Rule ("L[S.0.5349.120.41796.18")
	 (source 

"	(* Rules for deciding how much the HousePlayer could buy at a Producer.)

(* Sale can be limited by volume, weight, cash, or availability.)

-> volumeCapacity ← truck::MaxVolume-truck:volume
   weightCapacity ← truck::MaxWeight-truck:weight
   cashCapacity ← (MAX 0  truck:cashBox-cashReserve);")
	 (edited "27-JUL-83 11:44:45")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@ENE")))



(DEFINST Rule ("L[S.0.5349.120.41796.19")
	 (source 

"   
-> volumeLimit ← volumeCapacity / roadStop::Commodity::VolPerQty
   weightLimit ← weightCapacity / roadStop::Commodity::WtPerQty
   cashLimit ← cashCapacity / (PricePerUnit roadStop)
   producerLimit ← roadStop:qty;")
	 (edited "27-JUL-83 11:44:45")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "UVSC@ENE")))



(DEFINST Rule ("L[S.0.5349.120.41796.20")
	 (source "-> numBuy ← (MIN volumeLimit weightLimit cashLimit producerLimit);")
	 (edited "27-JUL-83 11:44:45")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "UVSC@ENE")))



(DEFINST Rule ("LZS.0.5349.129.33698.107")
	 (source 
      "	(* Rate the suitability of a proposed Consumer.)

-> cargo ← (CAR truck:cargo) rating←0;")
	 (edited "26-JUL-83 14:22:31")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.21")))



(DEFINST Rule ("LZS.0.5349.129.33698.108")
	 (source 

"(* Consumer must want current cargo.)
 IF ~(ISA cargo rs::Commodity)
  THEN (STOP -10000 NIL 'CannotSellHere);")
	 (edited "26-JUL-83 14:22:31")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.21")))



(DEFINST Rule ("LZS.0.5349.129.33698.109")
	 (source 

"(* Exclude consumers that have full inventory.)
 IF rs:qty < 1
  THEN (STOP -10000 NIL 'CannotSellHere);")
	 (edited "26-JUL-83 14:22:31")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.21")))



(DEFINST Rule ("LZS.0.5349.129.33698.110")
	 (source "(* Dont go if Bandits)
IF rs.BanditP
 THEN rating ← rating - 10000;")
	 (edited "26-JUL-83 14:22:31")
	 (editor MITTAL)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.21")))



(DEFINST Rule ("LZS.0.5349.129.33698.111")
	 (source "(* Favor high price ratios.)
  -> rating ← rating + 100 * rs:pr ;")
	 (edited "26-JUL-83 14:22:31")
	 (editor MITTAL)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.21")))



(DEFINST Rule ("LZS.0.5349.129.33698.112")
	 (source 
 "(* Favor close places.)
  -> rating ← rating - 5 * [truck::Gpm *(Distance rs truck:location)];")
	 (edited "26-JUL-83 14:22:31")
	 (editor MITTAL)
	 (ruleNumber 6)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.21")))



(DEFINST Rule ("LZS.0.5349.129.33698.113")
	 (source "(* rate gas stations within range)
 THEN rating ← 0;")
	 (edited "26-JUL-83 13:20:12")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "YSSC@<>m")))



(DEFINST Rule ("LZS.0.5349.129.33698.114")
	 (source "IF rs:qty=0 
 THEN rating ← -2000;")
	 (edited "26-JUL-83 13:20:12")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "YSSC@<>m")))



(DEFINST Rule ("LZS.0.5349.129.33698.115")
	 (source "IF ~(RoomToParkP rs)
 THEN rating ← rating - 200;")
	 (edited "26-JUL-83 13:20:12")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "YSSC@<>m")))



(DEFINST Rule ("LZS.0.5349.129.33698.116")
	 (source "IF rs.BanditP
 THEN rating ← rating - 200;")
	 (edited "26-JUL-83 13:20:12")
	 (editor MITTAL)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "YSSC@<>m")))



(DEFINST Rule ("LZS.0.5349.129.33698.117")
	 (source " THEN rating ← rating - [10 * (Distance rs truck:location)];")
	 (edited "26-JUL-83 13:20:12")
	 (editor MITTAL)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "YSSC@<>m")))



(DEFINST Rule ("LZS.0.5349.129.33698.118")
	 (source " THEN rating ← rating + (IMIN rs:qty truck::MaxFuel);")
	 (edited "26-JUL-83 13:20:12")
	 (editor MITTAL)
	 (ruleNumber 6)
	 (ruleSet #&(RuleSet "YSSC@<>m")))



(DEFINST Rule ("L[S.0.5349.120.41796.21")
	 (source "	(* Rate the suitability of a proposed Producer.)
-> rating ← 0;")
	 (edited "27-JUL-83 16:33:34")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.20")))



(DEFINST Rule ("L[S.0.5349.120.41796.22")
	 (source 
      "(* Exclude gas stations.)
 IF (ISA rs $GasStation)
  THEN (STOP -100000 NIL 'GasStation);")
	 (edited "27-JUL-83 16:33:34")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.20")))



(DEFINST Rule ("L[S.0.5349.120.41796.23")
	 (source 
  "(* Exclude producers that are sold out.)
 IF rs:qty < 1
  THEN (STOP -100000 NIL 'CannotBuy);")
	 (edited "27-JUL-83 16:33:34")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.20")))



(DEFINST Rule ("L[S.0.5349.120.41796.24")
	 (source 

"(* Penalize producers for which can buy < 1 items.)
 IF maxBuy←(← self MaxPurchase rs) 
    maxBuy < 1
  THEN (STOP -100000 NIL 'CannotBuy);")
	 (edited "27-JUL-83 16:33:34")
	 (editor MITTAL)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.20")))



(DEFINST Rule ("L[S.0.5349.120.41796.25")
	 (source "(* If Bandits there, dont go)
IF rs.BanditP
THEN rating ← rating - 10000;")
	 (edited "27-JUL-83 16:33:34")
	 (editor MITTAL)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.20")))



(DEFINST Rule ("L[S.0.5349.120.41796.26")
	 (source 

"(* Exclude perishables.)
 IF (SUBCLASS rs::Commodity $PerishableCommodity)
  THEN rating ← rating - 2000 + [100 * rs::Commodity::MinLifetime];")
	 (edited "27-JUL-83 16:33:34")
	 (editor MITTAL)
	 (ruleNumber 6)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.20")))



(DEFINST Rule ("L[S.0.5349.120.41796.27")
	 (source 
    "(* favor LuxuryGoods)
IF (SUBCLASS rs::Commodity $LuxuryGoods)
THEN rating ← rating + 2000;")
	 (edited "27-JUL-83 16:33:34")
	 (editor MITTAL)
	 (ruleNumber 7)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.20")))



(DEFINST Rule ("L[S.0.5349.120.41796.28")
	 (source "IF (SUBCLASS rs::Commodity $Xerox1100)
THEN rating ← rating + 2000 ;")
	 (edited "27-JUL-83 16:33:34")
	 (editor MITTAL)
	 (ruleNumber 8)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.20")))



(DEFINST Rule ("L[S.0.5349.120.41796.29")
	 (source "(* favor higher qty)
 -> rating ← rating + [10 * maxBuy];")
	 (edited "27-JUL-83 16:33:34")
	 (editor MITTAL)
	 (ruleNumber 9)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.20")))



(DEFINST Rule ("L[S.0.5349.120.41796.30")
	 (source 
"(* Favor close places.)
  -> rating ← rating - [10 * truck::Gpm * (Distance rs truck:location)];")
	 (edited "27-JUL-83 16:33:34")
	 (editor MITTAL)
	 (ruleNumber 10)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.20")))



(DEFINST Rule ("LZS.0.5349.129.33698.129")
	 (source 

"(* Rating RuleSet for spots near Alices.  Returns a number for spots.)

-> cargo ← (CAR truck:cargo);")
	 (edited "26-JUL-83 13:21:20")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "UVSC@END")))



(DEFINST Rule ("LZS.0.5349.129.33698.130")
	 (source 
	"   (* Favor places closer to Alices.)
-> rating ← 100 - 4 * (Distance roadStop alices);")
	 (edited "26-JUL-83 13:21:20")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "UVSC@END")))



(DEFINST Rule ("LZS.0.5349.129.33698.131")
	 (source "IF ~(RoomToParkP roadStop)
 THEN rating ← -1000;")
	 (edited "26-JUL-83 13:21:20")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "UVSC@END")))



(DEFINST Rule ("LZS.0.5349.129.33698.132")
	 (source "IF (ISA roadStop $UnionHall)
 THEN rating ← -1000;")
	 (edited "26-JUL-83 13:21:20")
	 (editor MITTAL)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "UVSC@END")))



(DEFINST Rule ("LZS.0.5349.129.33698.133")
	 (source "IF (ISA roadStop $AlicesRestaurant)
 THEN rating ← -500;")
	 (edited "26-JUL-83 13:21:20")
	 (editor MITTAL)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "UVSC@END")))



(DEFINST Rule ("LZS.0.5349.129.33698.134")
	 (source 

"IF cargo (ISA roadStop $Consumer) (ISA cargo roadStop::Commodity)
   roadStop:qty>0 roadStop:pr>1
 THEN rating ← rating + 20;")
	 (edited "26-JUL-83 13:21:20")
	 (editor MITTAL)
	 (ruleNumber 6)
	 (ruleSet #&(RuleSet "UVSC@END")))



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


	-> cargo←(CAR truck:cargo);")
	 (edited "26-JUL-83 16:08:28")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "YWSC@8@x")))



(DEFINST Rule ("LZS.0.5349.129.33698.204")
	 (source 
	 "	IF ~(ISA cargo truck:location::Commodity)
	THEN (STOP NIL 'NoSale 'WrongKindOfBuyer);")
	 (edited "26-JUL-83 16:08:28")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "YWSC@8@x")))



(DEFINST Rule ("LZS.0.5349.129.33698.205")
	 (source 

"        IF ~cargo:status (ISA truck:location $CityDump)
         THEN sellQty←(IMIN truck:location:qty cargo:qty)
              (← \PlayerInterface Sell self cargo sellQty)
              (STOP T 'Sold 'AtCityDump);")
	 (edited "26-JUL-83 16:08:28")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "YWSC@8@x")))



(DEFINST Rule ("LZS.0.5349.129.33698.206")
	 (source "	IF truck:location:pr < cargo:pr 
	THEN (STOP NIL 'NoSale 'AvoidLoss);")
	 (edited "26-JUL-83 16:08:28")
	 (editor MITTAL)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "YWSC@8@x")))



(DEFINST Rule ("LZS.0.5349.129.33698.188")
	 (source 

"	IF cargo:status sellQty←(IMIN truck:location:qty cargo:qty) sellQty>=1 
	THEN (← \PlayerInterface Sell self cargo sellQty) 
             cashReserve←(MIN 5000 (TIMES 0.1 truck:cashBox));")
	 (edited "26-JUL-83 16:08:28")
	 (editor MITTAL)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "YWSC@8@x")))



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

IF (ISA truck:location $AlicesRestaurant) .TimeAtStop>=29
 THEN goal←'LeaveAlice;")
	 (edited "26-JUL-83 14:17:11")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.54")))



(DEFINST Rule ("LZS.0.5349.129.33698.140")
	 (source "IF goal << '(SitTight BuyGas) THEN ;")
	 (edited "26-JUL-83 14:17:11")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.54")))



(DEFINST Rule ("LZS.0.5349.129.33698.141")
	 (source "IF goal='GoToAlice (ISA truck:location $AlicesRestaurant) 
 THEN goal←'SitTight;")
	 (edited "26-JUL-83 14:17:11")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.54")))



(DEFINST Rule ("LZS.0.5349.129.33698.142")
	 (source "IF \Simulator:timeLeft <30
 THEN goal←'GoToAlice higherGoal←'GoToAlice;")
	 (edited "26-JUL-83 14:17:11")
	 (editor MITTAL)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.54")))



(DEFINST Rule ("LZS.0.5349.129.33698.143")
	 (source 
    "IF truck:fuel < .35 * truck::MaxFuel  truck:cashBox > 0
 THEN higherGoal←goal goal←'BuyGas;")
	 (edited "26-JUL-83 14:17:11")
	 (editor MITTAL)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.54")))



(DEFINST Rule ("LZS.0.5349.129.33698.144")
	 (source "IF \Simulator:timeLeft < 60 
 THEN goal←'GetClose higherGoal←'GoToAlice;")
	 (edited "26-JUL-83 14:17:11")
	 (editor MITTAL)
	 (ruleNumber 6)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.54")))



(DEFINST Rule ("LZS.0.5349.129.33698.145")
	 (source "IF truck:fuel=0 truck:cashBox > 500000 
 THEN goal←'SitTight;")
	 (edited "26-JUL-83 14:17:11")
	 (editor MITTAL)
	 (ruleNumber 7)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.54")))



(DEFINST Rule ("LZS.0.5349.129.33698.146")
	 (source "IF truck:fuel=0 \Simulator:timeLeft > 300
 THEN goal←'UnionHall;")
	 (edited "26-JUL-83 14:17:11")
	 (editor MITTAL)
	 (ruleNumber 8)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.54")))



(DEFINST Rule ("LZS.0.5349.129.33698.147")
	 (source "IF truck:cargo
 THEN goal←'Sell;")
	 (edited "26-JUL-83 14:17:11")
	 (editor MITTAL)
	 (ruleNumber 9)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.54")))



(DEFINST Rule ("LZS.0.5349.129.33698.148")
	 (source "-> goal←'Buy;")
	 (edited "26-JUL-83 14:17:11")
	 (editor MITTAL)
	 (ruleNumber 10)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.54")))



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

 
 ->  .SetGoal;")
	 (edited "27-JUL-83 16:30:47")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.46")))



(DEFINST Rule ("L[S.0.5349.120.41796.32")
	 (source "IF goal THEN (←! self goal);")
	 (edited "27-JUL-83 16:30:47")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.46")))



(DEFINST Rule ("L[S.0.5349.120.41796.17")
	 (source 

"IF destination THEN horizon←(IMIN .Range1 (Distance destination)) 
                    .FindStoppingPlace;")
	 (edited "27-JUL-83 16:30:47")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.46")))



(DEFINST Rule ("L[S.0.5349.120.41796.33")
	 (source "IF destination stoppingPlace 
 THEN .GoToStoppingPlace
      .AtCurrentStop;")
	 (edited "27-JUL-83 16:30:47")
	 (editor MITTAL)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.46")))



(DEFINST Rule ("LZS.0.5349.129.33698.2")
	 (source 

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

  (* If no fuel, but close to end with enough cash, sit tight)
 IF truck:fuel=0 truck:cashBox > 300000  \gameMaster:timeRemaining < 300
  THEN destination←NIL  goal←'SitTight;")
	 (edited "26-JUL-83 13:14:32")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "YSSC@<>")))



(DEFINST Rule ("LZS.0.5349.129.33698.3")
	 (source 

"   (* Don't move away from Alices during endgame.)
 IF goal='GoToAlices (ISA truck:location $AlicesRestaurant)
  THEN goal←'SitTight;")
	 (edited "26-JUL-83 13:14:32")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "YSSC@<>")))



(DEFINST Rule ("LZS.0.5349.129.33698.4")
	 (source 

"   (* make sure not overstaying at Alices)
 IF goal='SitTight (ISA truck:location $AlicesRestaurant)
      .TimeAtStop >=28
  THEN destination← (NearestRoadStop(RoadStops $AlicesRestaurant ))
     goal='GoToAlices;")
	 (edited "26-JUL-83 13:14:32")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "YSSC@<>")))



(DEFINST Rule ("LZS.0.5349.129.33698.5")
	 (source 

"   (* Get near to Alices when time gets close)		
 IF \Simulator:timeLeft < 60 ~[goal<<'(SitTight GetClose GoToAlices)]  
  THEN alices←(NearestRoadStop (RoadStops $AlicesRestaurant))
       destination← (PickHiObj self 'RateSpotsNearAlices (RoadStops) )
       goal←'GetClose;")
	 (edited "26-JUL-83 13:14:32")
	 (editor MITTAL)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "YSSC@<>")))



(DEFINST Rule ("LZS.0.5349.129.33698.6")
	 (source 

"   (* Go to Alices now that it is time)
 IF \Simulator:timeLeft < 29 
    ~(ISA truck:location $AlicesRestaurant)   
  THEN destination← (NearestRoadStop (RoadStops $AlicesRestaurant NIL NIL T))
       goal←'GoToAlices ;")
	 (edited "26-JUL-83 13:14:32")
	 (editor MITTAL)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "YSSC@<>")))



(DEFINST Rule ("LZS.0.5349.129.33698.7")
	 (source 

" IF goal~='SitTight 
    truck:fuel < .35 * truck::MaxFuel
    truck:cashBox > 0
    gasStation←(PickHiObj self 'RateGasStations (RoadStops $GasStation .Range) )
  THEN goal←'BuyGas destination←gasStation;")
	 (edited "26-JUL-83 13:14:32")
	 (editor MITTAL)
	 (ruleNumber 6)
	 (ruleSet #&(RuleSet "YSSC@<>")))



(DEFINST Rule ("LZS.0.5349.129.33698.8")
	 (source 

" IF goal='Peddle truck:cargo  possibleStops←(Buyers (CAR truck:cargo) NIL T)
  THEN destination←(PickHiObj self 'RateConsumers possibleStops );")
	 (edited "26-JUL-83 13:14:32")
	 (editor MITTAL)
	 (ruleNumber 7)
	 (ruleSet #&(RuleSet "YSSC@<>")))



(DEFINST Rule ("LZS.0.5349.129.33698.9")
	 (source 

" IF goal='Peddle ~truck:cargo \Simulator:timeLeft > 70
    possibleStops←(RoadStops $Producer)
  THEN destination←(PickHiObj  self 'RateProducers possibleStops);")
	 (edited "26-JUL-83 13:14:32")
	 (editor MITTAL)
	 (ruleNumber 8)
	 (ruleSet #&(RuleSet "YSSC@<>")))



(DEFINST Rule ("LZS.0.5349.129.33698.152")
	 (source " IF destination
  THEN .GoToStoppingPlace;")
	 (edited "26-JUL-83 13:14:32")
	 (editor MITTAL)
	 (ruleNumber 9)
	 (ruleSet #&(RuleSet "YSSC@<>")))



(DEFINST Rule ("LZS.0.5349.129.33698.153")
	 (source "-> destination←(AnyRoadStop $UnionHall)
   direction←(DirectionOf destination);")
	 (edited "26-JUL-83 14:18:34")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "LZS.0.5349.129.33698.55")))



(DEFCLASSES HousePlanner HousePlayer)
[DEFCLASS HousePlanner
   (MetaClass PlayerMeta Edited:                             (* sm: "26-JUL-83 14:19"))
   (Supers Planner)
   (ClassVariables)
   (InstanceVariables (horizon 0 doc                         (* how far to look in deciding on stopping place)
			       ))
   (Methods (RateProducers RateProducersHousePlannerRules RuleSet RateProducersHousePlannerRules)
	    (RateConsumers RateConsumersHousePlannerRules RuleSet RateConsumersHousePlannerRules)
	    (RateGasStations RateGasStationsHousePlannerRules RuleSet 
			     RateGasStationsHousePlannerRules)
	    (FindStoppingPlace FindStoppingPlaceHousePlannerRules RuleSet 
			       FindStoppingPlaceHousePlannerRules)
	    (TakeTurn TakeTurnHousePlannerRules RuleSet TakeTurnHousePlannerRules)
	    (SetGoal SetGoalHousePlannerRules RuleSet SetGoalHousePlannerRules)
	    (UnionHall UnionHallHousePlanner RuleSet UnionHallHousePlanner)
	    (GoToStoppingPlace GoToStoppingPlaceHousePlannerRules RuleSet 
			       GoToStoppingPlaceHousePlannerRules doc 
                                                             (* RuleSet GoToStoppingPlacePeddlerRules is installed as
							     the selector GoToStoppingPlace of the class Peddler)
			       ))]

[DEFCLASS HousePlayer
   (MetaClass PlayerMeta Edited:                             (* sm: "26-JUL-83 13:23"))
   (Supers Traveler)
   (ClassVariables)
   (InstanceVariables (goal Peddle)
		      (destination NIL doc                   (* Current destination.))
		      (direction NIL doc                     (* Forward or Backward direction of travel on the 
							     highway.))
		      (alices NIL doc                        (* Instance of Alices chosen for end game.)
			      )
		      (cashReserve 1000 doc                  (* Minimum cash to keep on hand.)))
   (Methods (FindStoppingPlace FindStoppingPlaceHousePlayerRules RuleSet 
			       FindStoppingPlaceHousePlayerRules)
	    (GoToStoppingPlace GoToStoppingPlaceHousePlayerRules RuleSet 
			       GoToStoppingPlaceHousePlayerRules)
	    (SellGoods SellGoodsHousePlayerRules RuleSet SellGoodsHousePlayerRules)
	    (TakeTurn TakeTurnHousePlayerRules RuleSet TakeTurnHousePlayerRules)
	    (RateProducers HPRateProducers RuleSet HPRateProducers)
	    (RateConsumers HPRateConsumers RuleSet HPRateConsumers)
	    (RateGasStations HPRateGasStations RuleSet HPRateGasStations)
	    (RateSpotsNearAlices RateSpotsNearAlicesHousePlayerRules RuleSet 
				 RateSpotsNearAlicesHousePlayerRules)
	    (MaxPurchase MaxPurchaseHousePlayerRules RuleSet MaxPurchaseHousePlayerRules))]

(DEFINEQ

(FindStoppingPlaceHousePlannerRules
  [LAMBDA (self)
    (PROG (↑auditRecord ↑value wStation gasStation has roughRd)
          [COND
	    [(EQ (GetValue (GetValue self (QUOTE truck))
			   (QUOTE location))
		 (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.48")))
				  (PutAuditRec self (QUOTE stoppingPlace)
					       (GetValue self (QUOTE destination))
					       ↑auditRecord]
	    [[AND (GetValue (GetValue self (QUOTE truck))
			    (QUOTE cargo))
		  [SETQ wStation (NearestRoadStop (RoadStops ($ WeighStation)
							     (GetValue self (QUOTE horizon))
							     (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 "LZS.0.5349.129.33698.49")))
				  (PutAuditRec self (QUOTE stoppingPlace)
					       wStation ↑auditRecord]
	    [[AND (GetValue (GetValue self (QUOTE truck))
			    (QUOTE cargo))
		  [SETQ has (CAR (GetValue (GetValue self (QUOTE truck))
					   (QUOTE cargo]
		  (ISA has ($ FragileCommodity))
		  [SETQ roughRd (NearestRoadStop (RoadStops ($ RoughRoad)
							    (GetValue self (QUOTE horizon))
							    (GetValue self (QUOTE direction))
							    (QUOTE Room]
		  (LESSP (Distance roughRd)
			 (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 "LZS.0.5349.129.33698.50")))
				  (PutAuditRec self (QUOTE stoppingPlace)
					       roughRd ↑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 "LZS.0.5349.129.33698.51")))
				  (PutAuditRec self (QUOTE stoppingPlace)
					       (GetValue self (QUOTE destination))
					       ↑auditRecord]
	    [(AND (NEQ (GetValue self (QUOTE goal))
		       (QUOTE GoToAlices))
		  [LESSP (GetValue (GetValue self (QUOTE truck))
				   (QUOTE fuel))
			 (TIMES .6 (GetClassValue (GetValue self (QUOTE truck))
						  (QUOTE MaxFuel]
		  [SETQ gasStation (FurthestRoadStop (RoadStops ($ GasStation)
								(GetValue self (QUOTE horizon))
								(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 "LZS.0.5349.129.33698.52")))
				  (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 "LZS.0.5349.129.33698.53")))
				   (PutAuditRec self (QUOTE stoppingPlace)
						(NthRoadStop (GetValue self (QUOTE horizon))
							     (GetValue self (QUOTE direction))
							     NIL
							     (QUOTE Room))
						↑auditRecord]
      QUIT(RETURN ↑value])

(FindStoppingPlaceHousePlayerRules
  [LAMBDA (self)
    (PROG (↑auditRecord ↑value wStation gasStation)
          [COND
	    [(EQ (GetValue (GetValue self (QUOTE truck))
			   (QUOTE location))
		 (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.11")))
				  (PutAuditRec self (QUOTE stoppingPlace)
					       (GetValue self (QUOTE destination))
					       ↑auditRecord]
	    [[AND (GetValue (GetValue self (QUOTE truck))
			    (QUOTE cargo))
		  [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 "LZS.0.5349.129.33698.12")))
				  (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 "LZS.0.5349.129.33698.13")))
				  (PutAuditRec self (QUOTE stoppingPlace)
					       (GetValue self (QUOTE destination))
					       ↑auditRecord]
	    [(AND (NEQ (GetValue self (QUOTE goal))
		       (QUOTE GoToAlices))
		  [LESSP (GetValue (GetValue self (QUOTE truck))
				   (QUOTE fuel))
			 (TIMES .6 (GetClassValue (GetValue self (QUOTE truck))
						  (QUOTE MaxFuel]
		  [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 "LZS.0.5349.129.33698.14")))
				  (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 "LZS.0.5349.129.33698.15")))
				   (PutAuditRec self (QUOTE stoppingPlace)
						(NthRoadStop [IMIN (← self Range1)
								   (Distance (GetValue self
										       (QUOTE 
										      destination]
							     (GetValue self (QUOTE direction))
							     NIL
							     (QUOTE Room))
						↑auditRecord]
      QUIT(RETURN ↑value])

(GoToStoppingPlaceHousePlannerRules
  [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 (PROGN (WriteGameStatus (GetValue self (QUOTE driver))
						   " Not moving because of bandits")
				  (← PlayerInterface Move self (GetValue (GetValue self (QUOTE truck))
									 (QUOTE location]
	    (T (SETQ ↑value (← PlayerInterface Move self (GetValue self (QUOTE stoppingPlace]
      QUIT(RETURN ↑value])

(GoToStoppingPlaceHousePlayerRules
  [LAMBDA (self)
    (PROG (↑auditRecord ↑value realLocation numBuy)
          (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.16")))
			      (PutAuditRec self (QUOTE direction)
					   (DirectionOf (GetValue self (QUOTE destination)))
					   ↑auditRecord)))
          [SETQ ↑value (SETQ realLocation (GetValue (GetValue self (QUOTE truck))
						    (QUOTE location]
          [COND
	    ((AND (← self FindStoppingPlace)
		  (NEQ (GetValue self (QUOTE stoppingPlace))
		       (GetValue (GetValue self (QUOTE truck))
				 (QUOTE location)))
		  (NOT (← (GetValue self (QUOTE stoppingPlace))
			  BanditP)))
	      (SETQ ↑value (PROGN (← PlayerInterface Move self (GetValue self (QUOTE stoppingPlace)))
				  (SETQ realLocation (GetValue (GetValue self (QUOTE truck))
							       (QUOTE location]
          [COND
	    ((NEQ realLocation (GetValue self (QUOTE stoppingPlace)))
	      (SETQ ↑value (WriteGameStatus "Oh!! " (GetValue self (QUOTE driver))
					    " didnt go to stoppingPlace"]
          [COND
	    ((AND (ISA realLocation ($ GasStation))
		  (GREATERP (GetValue realLocation (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 "LZS.0.5349.129.33698.17")))
				  (← self BuyGas)
				  (PutAuditRec self (QUOTE goal)
					       (QUOTE Peddle)
					       ↑auditRecord)
				  (PutAuditRec self (QUOTE destination)
					       NIL ↑auditRecord)
				  (PROGN                     (* ↑value set by RuleSetStop)
					 (RuleSetStop (QUOTE Peddle)
						      NIL
						      (QUOTE BoughtGas))
					 (GO QUIT]
          [COND
	    ((AND (ISA realLocation ($ Producer))
		  (EQ (GetValue self (QUOTE goal))
		      (QUOTE Peddle))
		  (EQ realLocation (GetValue self (QUOTE destination)))
		  (SETQ numBuy (← self MaxPurchase realLocation))
		  (GEQ numBuy 1))
	      (SETQ ↑value (← PlayerInterface Buy self numBuy]
          [COND
	    ((AND (ISA realLocation ($ Consumer))
		  (GetValue (GetValue self (QUOTE truck))
			    (QUOTE cargo)))
	      (SETQ ↑value (← self SellGoods]
          [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.18")))
				  (PutAuditRec self (QUOTE destination)
					       NIL ↑auditRecord]
      QUIT(RETURN ↑value])

(HPRateConsumers
  [LAMBDA (self rs)
    (PROG (↑auditRecord ↑value rating cargo)
          (SETQ ↑value (PROGN [SETQ cargo (CAR (GetValue (GetValue self (QUOTE truck))
							 (QUOTE cargo]
			      (SETQ rating 0)))
          [COND
	    ((AND (NOT (GetValue cargo (QUOTE status)))
		  (ISA rs ($ CityDump)))
	      (SETQ ↑value (PROGN                            (* ↑value set by RuleSetStop)
				  (RuleSetStop 5000 (QUOTE CityDump)
					       (QUOTE LookNoMore))
				  (GO QUIT]
          [COND
	    ((NOT (GetValue cargo (QUOTE status)))
	      (SETQ ↑value (PROGN                            (* ↑value set by RuleSetStop)
				  (RuleSetStop NIL (QUOTE SpoiltGoods)
					       (QUOTE CannotSell))
				  (GO QUIT]
          [COND
	    ([NOT (ISA cargo (GetClassValue rs (QUOTE Commodity]
	      (SETQ ↑value (PROGN                            (* ↑value set by RuleSetStop)
				  (RuleSetStop (MINUS 10000)
					       NIL
					       (QUOTE CannotSellHere))
				  (GO QUIT]
          [COND
	    ((LESSP (GetValue rs (QUOTE qty))
		    1)
	      (SETQ ↑value (PROGN                            (* ↑value set by RuleSetStop)
				  (RuleSetStop (MINUS 10000)
					       NIL
					       (QUOTE CannotSellHere))
				  (GO QUIT]
          [COND
	    ((NOT (RoomToParkP rs))
	      (SETQ ↑value (SETQ rating (DIFFERENCE rating 200]
          [COND
	    ((← rs BanditP)
	      (SETQ ↑value (SETQ rating (DIFFERENCE rating 10000]
          [SETQ ↑value (SETQ rating (PLUS rating (TIMES 100 (GetValue rs (QUOTE pr]
          [SETQ ↑value (SETQ rating (DIFFERENCE rating
						(TIMES 5 (TIMES (GetClassValue (GetValue
										 self
										 (QUOTE truck))
									       (QUOTE Gpm))
								(Distance rs
									  (GetValue
									    (GetValue self
										      (QUOTE truck))
									    (QUOTE location]
      QUIT(RETURN ↑value])

(HPRateGasStations
  [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]
          [COND
	    ((← rs BanditP)
	      (SETQ ↑value (SETQ rating (DIFFERENCE rating 200]
          [SETQ ↑value (SETQ rating (DIFFERENCE rating (TIMES 10 (Distance
								rs
								(GetValue (GetValue self
										    (QUOTE truck))
									  (QUOTE location]
          [SETQ ↑value (SETQ rating (PLUS rating (IMIN (GetValue rs (QUOTE qty))
						       (GetClassValue (GetValue self (QUOTE truck))
								      (QUOTE MaxFuel]
      QUIT(RETURN ↑value])

(HPRateProducers
  [LAMBDA (self rs)
    (PROG (↑value rating maxBuy)
          (SETQ ↑value (SETQ rating 0))
          [COND
	    ((ISA rs ($ GasStation))
	      (SETQ ↑value (PROGN                            (* ↑value set by RuleSetStop)
				  (RuleSetStop (MINUS 100000)
					       NIL
					       (QUOTE GasStation))
				  (GO QUIT]
          [COND
	    ((LESSP (GetValue rs (QUOTE qty))
		    1)
	      (SETQ ↑value (PROGN                            (* ↑value set by RuleSetStop)
				  (RuleSetStop (MINUS 100000)
					       NIL
					       (QUOTE CannotBuy))
				  (GO QUIT]
          [COND
	    ((AND (SETQ maxBuy (← self MaxPurchase rs))
		  (LESSP maxBuy 1))
	      (SETQ ↑value (PROGN                            (* ↑value set by RuleSetStop)
				  (RuleSetStop (MINUS 100000)
					       NIL
					       (QUOTE CannotBuy))
				  (GO QUIT]
          [COND
	    ((NOT (RoomToParkP rs))
	      (SETQ ↑value (SETQ rating (MINUS 500]
          [COND
	    ((← rs BanditP)
	      (SETQ ↑value (SETQ rating (DIFFERENCE rating 10000]
          [COND
	    ((SUBCLASS (GetClassValue rs (QUOTE Commodity))
		       ($ PerishableCommodity))
	      (SETQ ↑value (SETQ rating (PLUS (DIFFERENCE rating 2000)
					      (TIMES 100 (GetClassValue (GetClassValue rs
										       (QUOTE 
											Commodity))
									(QUOTE MinLifetime]
          [COND
	    ((SUBCLASS (GetClassValue rs (QUOTE Commodity))
		       ($ FragileCommodity))
	      (SETQ ↑value (SETQ rating (DIFFERENCE rating (TIMES 100 (GetClassValue
								    (GetClassValue rs (QUOTE 
											Commodity))
								    (QUOTE FragilityLevel]
          [COND
	    ((SUBCLASS (GetClassValue rs (QUOTE Commodity))
		       ($ LuxuryGoods))
	      (SETQ ↑value (SETQ rating (PLUS rating 1000]
          [COND
	    ((SUBCLASS (GetClassValue rs (QUOTE Commodity))
		       ($ Xerox1100))
	      (SETQ ↑value (SETQ rating (PLUS rating 1000]
          [SETQ ↑value (SETQ rating (PLUS rating (TIMES 20 maxBuy]
          [SETQ ↑value (SETQ rating (DIFFERENCE rating (TIMES (TIMES 10 (GetClassValue
								       (GetValue self (QUOTE truck))
								       (QUOTE Gpm)))
							      (Distance rs
									(GetValue
									  (GetValue self
										    (QUOTE truck))
									  (QUOTE location]
      QUIT(RETURN ↑value])

(MaxPurchaseHousePlayerRules
  [LAMBDA (self roadStop)
    (PROG (↑auditRecord ↑value volumeCapacity weightCapacity volumeLimit weightLimit cashLimit 
			producerLimit numBuy cashCapacity)
          [SETQ ↑value (PROGN [SETQ volumeCapacity (DIFFERENCE (GetClassValue (GetValue self
											(QUOTE truck))
									      (QUOTE MaxVolume))
							       (GetValue (GetValue self (QUOTE truck))
									 (QUOTE volume]
			      [SETQ weightCapacity (DIFFERENCE (GetClassValue (GetValue self
											(QUOTE truck))
									      (QUOTE MaxWeight))
							       (GetValue (GetValue self (QUOTE truck))
									 (QUOTE weight]
			      (SETQ cashCapacity (MAX 0 (DIFFERENCE (GetValue (GetValue self
											(QUOTE truck))
									      (QUOTE cashBox))
								    (GetValue self (QUOTE cashReserve]
          [SETQ ↑value (PROGN [SETQ volumeLimit (QUOTIENT volumeCapacity (GetClassValue
							    (GetClassValue roadStop (QUOTE Commodity))
							    (QUOTE VolPerQty]
			      [SETQ weightLimit (QUOTIENT weightCapacity (GetClassValue
							    (GetClassValue roadStop (QUOTE Commodity))
							    (QUOTE WtPerQty]
			      (SETQ cashLimit (QUOTIENT cashCapacity (PricePerUnit roadStop)))
			      (SETQ producerLimit (GetValue roadStop (QUOTE qty]
          (SETQ ↑value (SETQ numBuy (MIN volumeLimit weightLimit cashLimit producerLimit)))
      QUIT(RETURN ↑value])

(RateConsumersHousePlannerRules
  [LAMBDA (self rs)
    (PROG (↑auditRecord ↑value rating cargo)
          (SETQ ↑value (PROGN [SETQ cargo (CAR (GetValue (GetValue self (QUOTE truck))
							 (QUOTE cargo]
			      (SETQ rating 0)))
          [COND
	    ([NOT (ISA cargo (GetClassValue rs (QUOTE Commodity]
	      (SETQ ↑value (PROGN                            (* ↑value set by RuleSetStop)
				  (RuleSetStop (MINUS 10000)
					       NIL
					       (QUOTE CannotSellHere))
				  (GO QUIT]
          [COND
	    ((LESSP (GetValue rs (QUOTE qty))
		    1)
	      (SETQ ↑value (PROGN                            (* ↑value set by RuleSetStop)
				  (RuleSetStop (MINUS 10000)
					       NIL
					       (QUOTE CannotSellHere))
				  (GO QUIT]
          [COND
	    ((← rs BanditP)
	      (SETQ ↑value (SETQ rating (DIFFERENCE rating 10000]
          [SETQ ↑value (SETQ rating (PLUS rating (TIMES 100 (GetValue rs (QUOTE pr]
          [SETQ ↑value (SETQ rating (DIFFERENCE rating
						(TIMES 5 (TIMES (GetClassValue (GetValue
										 self
										 (QUOTE truck))
									       (QUOTE Gpm))
								(Distance rs
									  (GetValue
									    (GetValue self
										      (QUOTE truck))
									    (QUOTE location]
      QUIT(RETURN ↑value])

(RateGasStationsHousePlannerRules
  [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]
          [COND
	    ((← rs BanditP)
	      (SETQ ↑value (SETQ rating (DIFFERENCE rating 200]
          [SETQ ↑value (SETQ rating (DIFFERENCE rating (TIMES 10 (Distance
								rs
								(GetValue (GetValue self
										    (QUOTE truck))
									  (QUOTE location]
          [SETQ ↑value (SETQ rating (PLUS rating (IMIN (GetValue rs (QUOTE qty))
						       (GetClassValue (GetValue self (QUOTE truck))
								      (QUOTE MaxFuel]
      QUIT(RETURN ↑value])

(RateProducersHousePlannerRules
  [LAMBDA (self rs)
    (PROG (↑value rating maxBuy)
          (SETQ ↑value (SETQ rating 0))
          [COND
	    ((ISA rs ($ GasStation))
	      (SETQ ↑value (PROGN                            (* ↑value set by RuleSetStop)
				  (RuleSetStop (MINUS 100000)
					       NIL
					       (QUOTE GasStation))
				  (GO QUIT]
          [COND
	    ((LESSP (GetValue rs (QUOTE qty))
		    1)
	      (SETQ ↑value (PROGN                            (* ↑value set by RuleSetStop)
				  (RuleSetStop (MINUS 100000)
					       NIL
					       (QUOTE CannotBuy))
				  (GO QUIT]
          [COND
	    ((AND (SETQ maxBuy (← self MaxPurchase rs))
		  (LESSP maxBuy 1))
	      (SETQ ↑value (PROGN                            (* ↑value set by RuleSetStop)
				  (RuleSetStop (MINUS 100000)
					       NIL
					       (QUOTE CannotBuy))
				  (GO QUIT]
          [COND
	    ((← rs BanditP)
	      (SETQ ↑value (SETQ rating (DIFFERENCE rating 10000]
          [COND
	    ((SUBCLASS (GetClassValue rs (QUOTE Commodity))
		       ($ PerishableCommodity))
	      (SETQ ↑value (SETQ rating (PLUS (DIFFERENCE rating 2000)
					      (TIMES 100 (GetClassValue (GetClassValue rs
										       (QUOTE 
											Commodity))
									(QUOTE MinLifetime]
          [COND
	    ((SUBCLASS (GetClassValue rs (QUOTE Commodity))
		       ($ LuxuryGoods))
	      (SETQ ↑value (SETQ rating (PLUS rating 2000]
          [COND
	    ((SUBCLASS (GetClassValue rs (QUOTE Commodity))
		       ($ Xerox1100))
	      (SETQ ↑value (SETQ rating (PLUS rating 2000]
          [SETQ ↑value (SETQ rating (PLUS rating (TIMES 10 maxBuy]
          [SETQ ↑value (SETQ rating (DIFFERENCE rating (TIMES (TIMES 10 (GetClassValue
								       (GetValue self (QUOTE truck))
								       (QUOTE Gpm)))
							      (Distance rs
									(GetValue
									  (GetValue self
										    (QUOTE truck))
									  (QUOTE location]
      QUIT(RETURN ↑value])

(RateSpotsNearAlicesHousePlayerRules
  [LAMBDA (self roadStop)
    (PROG (↑value rating cargo)
          [SETQ ↑value (SETQ cargo (CAR (GetValue (GetValue self (QUOTE truck))
						  (QUOTE cargo]
          [SETQ ↑value (SETQ rating (DIFFERENCE 100 (TIMES 4 (Distance roadStop (GetValue
									 self
									 (QUOTE alices]
          [COND
	    ((NOT (RoomToParkP roadStop))
	      (SETQ ↑value (SETQ rating (MINUS 1000]
          [COND
	    ((ISA roadStop ($ UnionHall))
	      (SETQ ↑value (SETQ rating (MINUS 1000]
          [COND
	    ((ISA roadStop ($ AlicesRestaurant))
	      (SETQ ↑value (SETQ rating (MINUS 500]
          [COND
	    ((AND cargo (ISA roadStop ($ Consumer))
		  (ISA cargo (GetClassValue roadStop (QUOTE Commodity)))
		  (GREATERP (GetValue roadStop (QUOTE qty))
			    0)
		  (GREATERP (GetValue roadStop (QUOTE pr))
			    1))
	      (SETQ ↑value (SETQ rating (PLUS rating 20]
      QUIT(RETURN ↑value])

(SellGoodsHousePlayerRules
  [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 (IMIN (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
	    ((LESSP (GetValue (GetValue (GetValue self (QUOTE truck))
					(QUOTE location))
			      (QUOTE pr))
		    (GetValue cargo (QUOTE pr)))
	      (SETQ ↑value (PROGN                            (* ↑value set by RuleSetStop)
				  (RuleSetStop NIL (QUOTE NoSale)
					       (QUOTE AvoidLoss))
				  (GO QUIT]
          [COND
	    ((AND (GetValue cargo (QUOTE status))
		  [SETQ sellQty (IMIN (GetValue (GetValue (GetValue self (QUOTE truck))
							  (QUOTE location))
						(QUOTE qty))
				      (GetValue cargo (QUOTE qty]
		  (GEQ sellQty 1))
	      (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.188")))
				  (← PlayerInterface Sell self cargo sellQty)
				  (PutAuditRec self (QUOTE cashReserve)
					       [MIN 5000 (TIMES .1 (GetValue (GetValue self
										       (QUOTE truck))
									     (QUOTE cashBox]
					       ↑auditRecord]
      QUIT(RETURN ↑value])

(SetGoalHousePlannerRules
  [LAMBDA (self)
    (PROG (↑value)
          [COND
	    [(AND (ISA (GetValue (GetValue self (QUOTE truck))
				 (QUOTE location))
		       ($ AlicesRestaurant))
		  (GEQ (← self TimeAtStop)
		       29))
	      (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 .35 (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]
	    [(AND (EQ (GetValue (GetValue self (QUOTE truck))
				(QUOTE fuel))
		      0)
		  (GREATERP (GetValue (GetValue self (QUOTE truck))
				      (QUOTE cashBox))
			    500000))
	      (SETQ ↑value (PutValue self (QUOTE goal)
				     (QUOTE SitTight]
	    [(AND (EQ (GetValue (GetValue self (QUOTE truck))
				(QUOTE fuel))
		      0)
		  (GREATERP (GetValue Simulator (QUOTE timeLeft))
			    300))
	      (SETQ ↑value (PutValue self (QUOTE goal)
				     (QUOTE UnionHall]
	    [(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])

(TakeTurnHousePlannerRules
  [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 (PROGN (PROGN                     (* Make an audit record for this rule and set its audit 
							     values.)
					 (SETQ ↑auditRecord (← ($ StandardAuditRecord)
							       NewTemp))
					 (PutValue ↑auditRecord (QUOTE rule)
						   (GetObjFromUID "L[S.0.5349.120.41796.17")))
				  (PutAuditRec self (QUOTE horizon)
					       [IMIN (← self Range1)
						     (Distance (GetValue self (QUOTE destination]
					       ↑auditRecord)
				  (← self FindStoppingPlace]
          [COND
	    ((AND (GetValue self (QUOTE destination))
		  (GetValue self (QUOTE stoppingPlace)))
	      (SETQ ↑value (PROGN (← self GoToStoppingPlace)
				  (← self AtCurrentStop]
      QUIT(RETURN ↑value])

(TakeTurnHousePlayerRules
  [LAMBDA (self)
    (PROG (↑auditRecord ↑value possibleStops gasStation)
          [COND
	    ((AND (EQ (GetValue (GetValue self (QUOTE truck))
				(QUOTE fuel))
		      0)
		  (GREATERP (GetValue (GetValue self (QUOTE truck))
				      (QUOTE cashBox))
			    300000)
		  (LESSP (GetValue gameMaster (QUOTE timeRemaining))
			 300))
	      (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.2")))
				  (PutAuditRec self (QUOTE destination)
					       NIL ↑auditRecord)
				  (PutAuditRec self (QUOTE goal)
					       (QUOTE SitTight)
					       ↑auditRecord]
          [COND
	    ((AND (EQ (GetValue self (QUOTE goal))
		      (QUOTE GoToAlices))
		  (ISA (GetValue (GetValue self (QUOTE truck))
				 (QUOTE location))
		       ($ AlicesRestaurant)))
	      (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.3")))
				  (PutAuditRec self (QUOTE goal)
					       (QUOTE SitTight)
					       ↑auditRecord]
          [COND
	    ((AND (EQ (GetValue self (QUOTE goal))
		      (QUOTE SitTight))
		  (ISA (GetValue (GetValue self (QUOTE truck))
				 (QUOTE location))
		       ($ AlicesRestaurant))
		  (GEQ (← self TimeAtStop)
		       28))
	      (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.4")))
				  (PutAuditRec self (QUOTE destination)
					       (NearestRoadStop (RoadStops ($ AlicesRestaurant)))
					       ↑auditRecord)
				  (EQ (GetValue self (QUOTE goal))
				      (QUOTE GoToAlices]
          [COND
	    ([AND (LESSP (GetValue Simulator (QUOTE timeLeft))
			 60)
		  (NOT (FMEMB (GetValue self (QUOTE goal))
			      (QUOTE (SitTight GetClose GoToAlices]
	      (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.5")))
				  (PutAuditRec self (QUOTE alices)
					       (NearestRoadStop (RoadStops ($ AlicesRestaurant)))
					       ↑auditRecord)
				  (PutAuditRec self (QUOTE destination)
					       (PickHiObj self (QUOTE RateSpotsNearAlices)
							  (RoadStops))
					       ↑auditRecord)
				  (PutAuditRec self (QUOTE goal)
					       (QUOTE GetClose)
					       ↑auditRecord]
          [COND
	    ([AND (LESSP (GetValue Simulator (QUOTE timeLeft))
			 29)
		  (NOT (ISA (GetValue (GetValue self (QUOTE truck))
				      (QUOTE location))
			    ($ AlicesRestaurant]
	      (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.6")))
				  (PutAuditRec self (QUOTE destination)
					       (NearestRoadStop (RoadStops ($ AlicesRestaurant)
									   NIL NIL T))
					       ↑auditRecord)
				  (PutAuditRec self (QUOTE goal)
					       (QUOTE GoToAlices)
					       ↑auditRecord]
          [COND
	    ([AND (NEQ (GetValue self (QUOTE goal))
		       (QUOTE SitTight))
		  [LESSP (GetValue (GetValue self (QUOTE truck))
				   (QUOTE fuel))
			 (TIMES .35 (GetClassValue (GetValue self (QUOTE truck))
						   (QUOTE MaxFuel]
		  (GREATERP (GetValue (GetValue self (QUOTE truck))
				      (QUOTE cashBox))
			    0)
		  (SETQ gasStation (PickHiObj self (QUOTE RateGasStations)
					      (RoadStops ($ GasStation)
							 (← self Range]
	      (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.7")))
				  (PutAuditRec self (QUOTE goal)
					       (QUOTE BuyGas)
					       ↑auditRecord)
				  (PutAuditRec self (QUOTE destination)
					       gasStation ↑auditRecord]
          [COND
	    ((AND (EQ (GetValue self (QUOTE goal))
		      (QUOTE Peddle))
		  (GetValue (GetValue self (QUOTE truck))
			    (QUOTE cargo))
		  (SETQ possibleStops (Buyers (CAR (GetValue (GetValue self (QUOTE truck))
							     (QUOTE cargo)))
					      NIL 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 "LZS.0.5349.129.33698.8")))
				  (PutAuditRec self (QUOTE destination)
					       (PickHiObj self (QUOTE RateConsumers)
							  possibleStops)
					       ↑auditRecord]
          [COND
	    ([AND (EQ (GetValue self (QUOTE goal))
		      (QUOTE Peddle))
		  (NOT (GetValue (GetValue self (QUOTE truck))
				 (QUOTE cargo)))
		  (GREATERP (GetValue Simulator (QUOTE timeLeft))
			    70)
		  (SETQ possibleStops (RoadStops ($ Producer]
	      (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.9")))
				  (PutAuditRec self (QUOTE destination)
					       (PickHiObj self (QUOTE RateProducers)
							  possibleStops)
					       ↑auditRecord]
          [COND
	    ((GetValue self (QUOTE destination))
	      (SETQ ↑value (← self GoToStoppingPlace]
      QUIT(RETURN ↑value])

(UnionHallHousePlanner
  [LAMBDA (self)
    (PROG (↑value)
          [COND
	    (T (SETQ ↑value (PROGN (PutValue self (QUOTE destination)
					     (AnyRoadStop ($ UnionHall)))
				   (PutValue self (QUOTE direction)
					     (DirectionOf (GetValue self (QUOTE destination]
      QUIT(RETURN ↑value])
)
(DECLARE: DONTCOPY
  (FILEMAP (NIL (54168 88954 (FindStoppingPlaceHousePlannerRules 54178 . 58389) (
FindStoppingPlaceHousePlayerRules 58391 . 61794) (GoToStoppingPlaceHousePlannerRules 61796 . 62512) (
GoToStoppingPlaceHousePlayerRules 62514 . 65547) (HPRateConsumers 65549 . 67407) (HPRateGasStations 
67409 . 68202) (HPRateProducers 68204 . 70504) (MaxPurchaseHousePlayerRules 70506 . 71891) (
RateConsumersHousePlannerRules 71893 . 73156) (RateGasStationsHousePlannerRules 73158 . 73966) (
RateProducersHousePlannerRules 73968 . 75919) (RateSpotsNearAlicesHousePlayerRules 75921 . 76857) (
SellGoodsHousePlayerRules 76859 . 79092) (SetGoalHousePlannerRules 79094 . 81310) (
TakeTurnHousePlannerRules 81312 . 82349) (TakeTurnHousePlayerRules 82351 . 88645) (
UnionHallHousePlanner 88647 . 88952)))))
STOP