(FILECREATED "15-JUL-83 15:02:09" {IVY}<LOOPSCOURSE>BENSON>TEAMSTER.;6 76632  

      changes to:  (FNS FindStoppingPlaceTeamsterRules RateProducersTeamsterRules GetPriceRatio 
			Teamster.SelectPr MaxPurchaseTeamsterRules RateSpotsNearAlicesTeamsterRules 
			GoToStoppingPlaceTeamsterRules RateConsumersTeamsterRules 
			SellGoodsTeamsterRules TakeTurnTeamsterRules TakeTurnBigMacRules)
		   (INSTANCES GetPriceRatio FindStoppingPlaceTeamsterRules MaxPurchaseTeamsterRules 
			      RateProducersTeamsterRules RateSpotsNearAlicesTeamsterRules 
			      GoToStoppingPlaceTeamsterRules RateConsumersTeamsterRules 
			      SellGoodsTeamsterRules TakeTurnTeamsterRules)
		   (VARS TEAMSTERCOMS)
		   (CLASSES Teamster)

      previous date: "15-JUL-83 13:07:47" {IVY}<LOOPSCOURSE>BENSON>TEAMSTER.;5)


(PRETTYCOMPRINT TEAMSTERCOMS)

(RPAQQ TEAMSTERCOMS ((CLASSES Teamster)
		     (INSTANCES FindStoppingPlaceTeamsterRules GetPriceRatio 
				GoToStoppingPlaceTeamsterRules MaxPurchaseTeamsterRules 
				RateConsumersTeamsterRules RateProducersTeamsterRules 
				RateSpotsNearAlicesTeamsterRules SellGoodsTeamsterRules 
				TakeTurnTeamsterRules)
		     (FNS FindStoppingPlaceTeamsterRules GetPriceRatio GoToStoppingPlaceTeamsterRules 
			  MaxPurchaseTeamsterRules RateConsumersTeamsterRules 
			  RateProducersTeamsterRules RateSpotsNearAlicesTeamsterRules 
			  SellGoodsTeamsterRules TakeTurnBigMacRules TakeTurnTeamsterRules 
			  Teamster.SelectPr)))
(DEFCLASSES Teamster)
[DEFCLASS Teamster
   (MetaClass PlayerMeta Edited:                             (* edited: "15-JUL-83 10:46"))
   (Supers Peddler)
   (ClassVariables (CopyCV (Icon InitializeIVs))
		   (InitializeIVs ?)
		   (Icon ?))
   (InstanceVariables (cashReserve 2000))
   (Methods (TakeTurn TakeTurnTeamsterRules RuleSet TakeTurnTeamsterRules args NIL doc 
                                                             (* RuleSet TakeTurnPeddlerRules is installed as the 
							     selector TakeTurn of the class Peddler))
	    (SellGoods SellGoodsTeamsterRules RuleSet SellGoodsTeamsterRules doc 
                                                             (* RuleSet SellGoodsPeddlerRules is installed as the 
							     selector SellGoods of the class Peddler))
	    (RateConsumers RateConsumersTeamsterRules RuleSet RateConsumersTeamsterRules doc 
                                                             (* RuleSet PeddlerRateConsumers is installed as the 
							     selector RateConsumers of the class Peddler)
			   )
	    (GoToStoppingPlace GoToStoppingPlaceTeamsterRules RuleSet GoToStoppingPlaceTeamsterRules 
			       doc                           (* RuleSet GoToStoppingPlacePeddlerRules is installed as
							     the selector GoToStoppingPlace of the class Peddler)
			       )
	    (RateSpotsNearAlices RateSpotsNearAlicesTeamsterRules RuleSet 
				 RateSpotsNearAlicesTeamsterRules)
	    (RateProducers RateProducersTeamsterRules RuleSet RateProducersTeamsterRules)
	    (MaxPurchase MaxPurchaseTeamsterRules RuleSet MaxPurchaseTeamsterRules)
	    (FindStoppingPlace FindStoppingPlaceTeamsterRules RuleSet FindStoppingPlaceTeamsterRules 
			       doc                           (* RuleSet FindStoppingPlacePeddlerRules is installed as
							     the selector FindStoppingPlace of the class Peddler)
			       )
	    (SelectPr Teamster.SelectPr args (roadStop)
		      doc                                    (* Select a price ratio and return it)
		      ))]

(DEFINST RuleSet (FindStoppingPlaceTeamsterRules "LNS.0.5349.46.57775.63")
	 (perspectiveNode #&(RuleSetNode "LNS.0.5349.46.57775.153") myViewName RuleSet)
	 (name #(FindStoppingPlaceTeamsterRules NIL RememberName))
	 (compiledRules FindStoppingPlaceTeamsterRules)
	 (workSpace Teamster)
	 (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 (GetPriceRatio "LNS.0.5349.46.57775.117")
	 (perspectiveNode #&(RuleSetNode "LNS.0.5349.46.57775.154"))
	 (name #(GetPriceRatio NIL RememberName))
	 (compiledRules GetPriceRatio)
	 (workSpace Teamster)
	 (args (roadStop))
	 (tempVars (priceRatio))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 1)
	 (controlStructure DOALL)
	 (whileCondition NIL)
	 (compilerOptions NIL)
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass))



(DEFINST RuleSet (GoToStoppingPlaceTeamsterRules "LNS.0.5349.46.57775.58")
	 (perspectiveNode #&(RuleSetNode "LNS.0.5349.46.57775.155") myViewName RuleSet)
	 (name #(GoToStoppingPlaceTeamsterRules NIL RememberName))
	 (compiledRules GoToStoppingPlaceTeamsterRules)
	 (workSpace Teamster)
	 (args NIL)
	 (tempVars (realLocation numBuy))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 7)
	 (controlStructure DOALL)
	 (whileCondition NIL)
	 (compilerOptions (A))
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass))



(DEFINST RuleSet (MaxPurchaseTeamsterRules "LNS.0.5349.46.57775.62")
	 (perspectiveNode #&(RuleSetNode "LNS.0.5349.46.57775.156") myViewName RuleSet)
	 (name #(MaxPurchaseTeamsterRules NIL RememberName))
	 (compiledRules MaxPurchaseTeamsterRules)
	 (workSpace Teamster)
	 (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 (RateConsumersTeamsterRules "LNS.0.5349.46.57775.57")
	 (perspectiveNode #&(RuleSetNode "LNS.0.5349.46.57775.157") myViewName RuleSet)
	 (name #(RateConsumersTeamsterRules NIL RememberName))
	 (compiledRules RateConsumersTeamsterRules)
	 (workSpace Teamster)
	 (args (roadStop))
	 (tempVars (rating cargo))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 8)
	 (controlStructure DOALL)
	 (whileCondition NIL)
	 (compilerOptions (A))
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass))



(DEFINST RuleSet (RateProducersTeamsterRules "LNS.0.5349.46.57775.61")
	 (perspectiveNode #&(RuleSetNode "LNS.0.5349.46.57775.158") myViewName RuleSet)
	 (name #(RateProducersTeamsterRules NIL RememberName))
	 (compiledRules RateProducersTeamsterRules)
	 (workSpace Teamster)
	 (args (roadStop))
	 (tempVars (rating maxBuy possibleConsumer expPr expProfit))
	 (taskVars NIL)
	 (debugVars (maxBuy rating expPr expProfit))
	 (numRules 8)
	 (controlStructure DOALL)
	 (whileCondition NIL)
	 (compilerOptions NIL)
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass))



(DEFINST RuleSet (RateSpotsNearAlicesTeamsterRules "LNS.0.5349.46.57775.60")
	 (perspectiveNode #&(RuleSetNode "LNS.0.5349.46.57775.159") myViewName RuleSet)
	 (name #(RateSpotsNearAlicesTeamsterRules NIL RememberName))
	 (compiledRules RateSpotsNearAlicesTeamsterRules)
	 (workSpace Teamster)
	 (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 (SellGoodsTeamsterRules "LNS.0.5349.46.57775.56")
	 (perspectiveNode #&(RuleSetNode "LNS.0.5349.46.57775.160") myViewName RuleSet)
	 (name #(SellGoodsTeamsterRules NIL RememberName))
	 (compiledRules SellGoodsTeamsterRules)
	 (workSpace Teamster)
	 (args NIL)
	 (tempVars (cargo sellQty))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 6)
	 (controlStructure DOALL)
	 (whileCondition NIL)
	 (compilerOptions (A))
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass))



(DEFINST RuleSet (TakeTurnTeamsterRules "LNS.0.5349.46.57775.48")
	 (perspectiveNode #&(RuleSetNode "LNS.0.5349.46.57775.161") myViewName RuleSet)
	 (name #(TakeTurnTeamsterRules NIL RememberName))
	 (compiledRules TakeTurnTeamsterRules)
	 (workSpace Teamster)
	 (args NIL)
	 (tempVars (possibleStops))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 8)
	 (controlStructure DOALL)
	 (whileCondition NIL)
	 (compilerOptions (A))
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass))



(DEFINST RuleSetNode ("LNS.0.5349.46.57775.153")
	 (perspectives ? RuleSet #&(RuleSet "LNS.0.5349.46.57775.63") Source 
		       #&(RuleSetSource "LNS.0.5349.46.57775.162")))



(DEFINST RuleSetNode ("LNS.0.5349.46.57775.154")
	 (perspectives ? RuleSet #&(RuleSet "LNS.0.5349.46.57775.117") Source 
		       #&(RuleSetSource "LNS.0.5349.46.57775.163")))



(DEFINST RuleSetNode ("LNS.0.5349.46.57775.155")
	 (perspectives ? RuleSet #&(RuleSet "LNS.0.5349.46.57775.58") Source 
		       #&(RuleSetSource "LNS.0.5349.46.57775.164")))



(DEFINST RuleSetNode ("LNS.0.5349.46.57775.156")
	 (perspectives ? RuleSet #&(RuleSet "LNS.0.5349.46.57775.62") Source 
		       #&(RuleSetSource "LNS.0.5349.46.57775.165")))



(DEFINST RuleSetNode ("LNS.0.5349.46.57775.157")
	 (perspectives ? RuleSet #&(RuleSet "LNS.0.5349.46.57775.57") Source 
		       #&(RuleSetSource "LNS.0.5349.46.57775.166")))



(DEFINST RuleSetNode ("LNS.0.5349.46.57775.158")
	 (perspectives ? RuleSet #&(RuleSet "LNS.0.5349.46.57775.61") Source 
		       #&(RuleSetSource "LNS.0.5349.46.57775.167")))



(DEFINST RuleSetNode ("LNS.0.5349.46.57775.159")
	 (perspectives ? RuleSet #&(RuleSet "LNS.0.5349.46.57775.60") Source 
		       #&(RuleSetSource "LNS.0.5349.46.57775.168")))



(DEFINST RuleSetNode ("LNS.0.5349.46.57775.160")
	 (perspectives ? RuleSet #&(RuleSet "LNS.0.5349.46.57775.56") Source 
		       #&(RuleSetSource "LNS.0.5349.46.57775.169")))



(DEFINST RuleSetNode ("LNS.0.5349.46.57775.161")
	 (perspectives ? RuleSet #&(RuleSet "LNS.0.5349.46.57775.48") Source 
		       #&(RuleSetSource "LNS.0.5349.46.57775.170")))



(DEFINST RuleSetSource ("LNS.0.5349.46.57775.162")
	 (indexedVars ((#&(Rule "LNS.0.5349.46.57775.71"))
		       (#&(Rule "LNS.0.5349.46.57775.72"))
		       (#&(Rule "LNS.0.5349.46.57775.73"))
		       (#&(Rule "LNS.0.5349.46.57775.74"))
		       (#&(Rule "LNS.0.5349.46.57775.75"))
		       (#&(Rule "LESC@8BJ"))
		       (#&(Rule "FAS@@&Lp"))))
	 (perspectiveNode #&(RuleSetNode "LNS.0.5349.46.57775.153") myViewName Source)
	 (created " 1-FEB-83 14:25:23")
	 (creator LOOPSCOURSE)
	 (edited "15-JUL-83 08:56:27")
	 (editor BENSON))



(DEFINST RuleSetSource ("LNS.0.5349.46.57775.163")
	 (indexedVars ((#&(Rule "LNS.0.5349.46.57775.171"))))
	 (perspectiveNode #&(RuleSetNode "LNS.0.5349.46.57775.154"))
	 (created "15-JUL-83 10:50:42")
	 (creator LOOPSCOURSE)
	 (edited "15-JUL-83 10:55:13")
	 (editor BENSON))



(DEFINST RuleSetSource ("LNS.0.5349.46.57775.164")
	 (indexedVars ((#&(Rule "LESC@8B"))
		       (#&(Rule "LESC@8BK"))
		       (#&(Rule "LESC@8BL"))
		       (#&(Rule "LESC@8BM"))
		       (#&(Rule "LESC@8BN"))
		       (#&(Rule "LESC@8BO"))
		       (#&(Rule "LESC@8BP"))))
	 (perspectiveNode #&(RuleSetNode "LNS.0.5349.46.57775.155") myViewName Source)
	 (created " 1-FEB-83 14:25:34")
	 (creator LOOPSCOURSE)
	 (edited " 5-JUL-83 11:58:34")
	 (editor MITTAL))



(DEFINST RuleSetSource ("LNS.0.5349.46.57775.165")
	 (indexedVars ((#&(Rule "UISC@AMT"))
		       (#&(Rule "UISC@AMU"))
		       (#&(Rule "UISC@AMV"))
		       (#&(Rule "UISC@<{l"))
		       (#&(Rule "FBS@@A?V"))))
	 (perspectiveNode #&(RuleSetNode "LNS.0.5349.46.57775.156") myViewName Source)
	 (created " 1-FEB-83 14:25:11")
	 (creator LOOPSCOURSE)
	 (edited " 9-JUN-83 22:34:09")
	 (editor STEFIK))



(DEFINST RuleSetSource ("LNS.0.5349.46.57775.166")
	 (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 "LNS.0.5349.46.57775.157") myViewName Source)
	 (created "18-FEB-83 22:45:14")
	 (creator STEFIK)
	 (edited " 9-JUN-83 21:28:08")
	 (editor STEFIK))



(DEFINST RuleSetSource ("LNS.0.5349.46.57775.167")
	 (indexedVars ((#&(Rule "LNS.0.5349.46.57775.172"))
		       (#&(Rule "LNS.0.5349.46.57775.173"))
		       (#&(Rule "LNS.0.5349.46.57775.174"))
		       (#&(Rule "LNS.0.5349.46.57775.175"))
		       (#&(Rule "LNS.0.5349.46.57775.176"))
		       (#&(Rule "LNS.0.5349.46.57775.177"))
		       (#&(Rule "LNS.0.5349.46.57775.178"))
		       (#&(Rule "LNS.0.5349.46.57775.179"))
		       (#&(Rule "LNS.0.5349.46.57775.180"))
		       (#&(Rule "LNS.0.5349.46.57775.181"))
		       (#&(Rule "UISC@AMi"))
		       (#&(Rule "FYSC@}d"))))
	 (perspectiveNode #&(RuleSetNode "LNS.0.5349.46.57775.158") myViewName Source)
	 (created "18-FEB-83 22:45:14")
	 (creator STEFIK)
	 (edited "15-JUL-83 12:47:38")
	 (editor BENSON))



(DEFINST RuleSetSource ("LNS.0.5349.46.57775.168")
	 (indexedVars ((#&(Rule "UISC@AMj"))
		       (#&(Rule "UISC@AMk"))
		       (#&(Rule "UISC@AMl"))
		       (#&(Rule "UISC@AMm"))
		       (#&(Rule "UISC@AMn"))
		       (#&(Rule "UISC@AMo"))))
	 (perspectiveNode #&(RuleSetNode "LNS.0.5349.46.57775.159") myViewName Source)
	 (created "18-FEB-83 20:41:23")
	 (creator STEFIK)
	 (edited " 9-JUN-83 22:03:23")
	 (editor STEFIK))



(DEFINST RuleSetSource ("LNS.0.5349.46.57775.169")
	 (indexedVars ((#&(Rule "LESC@8BQ"))
		       (#&(Rule "LESC@8BR"))
		       (#&(Rule "LESC@8BS"))
		       (#&(Rule "LESC@8BT"))
		       (#&(Rule "LESC@8BU"))
		       (#&(Rule "LESC@8BV"))
		       (#&(Rule "FBS@@A?b"))
		       (#&(Rule "FBS@@A?c"))))
	 (perspectiveNode #&(RuleSetNode "LNS.0.5349.46.57775.160") myViewName Source)
	 (created " 1-FEB-83 14:25:40")
	 (creator LOOPSCOURSE)
	 (edited " 5-JUL-83 11:57:52")
	 (editor MITTAL))



(DEFINST RuleSetSource ("LNS.0.5349.46.57775.170")
	 (indexedVars ((#&(Rule "LESC@8B>"))
		       (#&(Rule "LESC@8B?"))
		       (#&(Rule "LESC@8B@"))
		       (#&(Rule "LESC@8BA"))
		       (#&(Rule "LESC@8BB"))
		       (#&(Rule "LESC@8BC"))
		       (#&(Rule "LESC@8BD"))
		       (#&(Rule "LESC@8BW"))))
	 (perspectiveNode #&(RuleSetNode "LNS.0.5349.46.57775.161") myViewName Source)
	 (created " 1-FEB-83 14:25:51")
	 (creator LOOPSCOURSE)
	 (edited " 5-JUL-83 12:00:00")
	 (editor MITTAL))



(DEFINST Rule ("LNS.0.5349.46.57775.71")
	 (source 

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

IF truck:fuel=0
THEN stoppingPlace←(AnyRoadStop $UnionHall);")
	 (edited "15-JUL-83 08:56:27")
	 (editor BENSON)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "LNS.0.5349.46.57775.63")))



(DEFINST Rule ("LNS.0.5349.46.57775.72")
	 (source 

"(* Dont run out of gas.)
IF goal~='SitTight 
   truck:fuel < .25 * truck::MaxFuel
   truck:cashBox>0
   gasStation←(NearestRoadStop (RoadStops $GasStation .Range1
                                             direction 'Room))
THEN stoppingPlace←gasStation;")
	 (edited "15-JUL-83 08:56:27")
	 (editor BENSON)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "LNS.0.5349.46.57775.63")))



(DEFINST Rule ("LNS.0.5349.46.57775.73")
	 (source 

"(* Obey the law - stop at WeighStations.)
IF wStation←(NearestRoadStop (RoadStops $WeighStation .Range1 direction 'Room))
   (Distance wStation)<(Distance destination) 
THEN stoppingPlace←wStation;")
	 (edited "15-JUL-83 08:56:27")
	 (editor BENSON)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "LNS.0.5349.46.57775.63")))



(DEFINST Rule ("LNS.0.5349.46.57775.74")
	 (source 
   "IF (Distance destination)<=.Range1 (RoomToParkP destination)
THEN stoppingPlace←destination;")
	 (edited "15-JUL-83 08:56:27")
	 (editor BENSON)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "LNS.0.5349.46.57775.63")))



(DEFINST Rule ("LNS.0.5349.46.57775.75")
	 (source "THEN stoppingPlace←(NthRoadStop  maxMove direction NIL 'Room);")
	 (edited "15-JUL-83 08:56:27")
	 (editor BENSON)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "LNS.0.5349.46.57775.63")))



(DEFINST Rule ("LESC@8BJ")
	 (source "THEN stoppingPlace←(NthRoadStop  maxMove direction NIL 'Room);")
	 (edited " 5-JUL-83 12:01:40")
	 (editor MITTAL)
	 (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 ("LNS.0.5349.46.57775.171")
	 (source "(* Get the priceRatio from a roadstop)

-> priceRatio ← roadStop:pr;")
	 (edited "15-JUL-83 10:55:13")
	 (editor BENSON)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "LNS.0.5349.46.57775.117")))



(DEFINST Rule ("LESC@8B")
	 (source "	-> direction←(DirectionOf destination);")
	 (edited " 5-JUL-83 11:58:34")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "FRSC@$PA")))



(DEFINST Rule ("LESC@8BK")
	 (source "        -> realLocation←truck:location;")
	 (edited " 5-JUL-83 11:58:34")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "FRSC@$PA")))



(DEFINST Rule ("LESC@8BL")
	 (source 

"	IF .FindStoppingPlace stoppingPlace~=truck:location
          ~stoppingPlace.BanditP
	THEN (← \PlayerInterface Move self stoppingPlace)
               realLocation←truck:location;")
	 (edited " 5-JUL-83 11:58:34")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "FRSC@$PA")))



(DEFINST Rule ("LESC@8BM")
	 (source 

"        IF realLocation~=stoppingPlace 
	THEN (WriteGameStatus %"Oh!! %" driver %" Didnt reach stoppingPlace%");")
	 (edited " 5-JUL-83 11:58:34")
	 (editor MITTAL)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "FRSC@$PA")))



(DEFINST Rule ("LESC@8BN")
	 (source "	IF (ISA realLocation $GasStation)
	THEN .BuyGas;")
	 (edited " 5-JUL-83 11:58:34")
	 (editor MITTAL)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "FRSC@$PA")))



(DEFINST Rule ("LESC@8BO")
	 (source 

"	IF (ISA realLocation $Producer) ~(ISA realLocation $GasStation)
           goal='Peddle
	   realLocation=destination 
           numBuy←(← self MaxPurchase realLocation)
           numBuy>=1  
	THEN (← \PlayerInterface Buy self numBuy);")
	 (edited " 5-JUL-83 11:58:34")
	 (editor MITTAL)
	 (ruleNumber 6)
	 (ruleSet #&(RuleSet "FRSC@$PA")))



(DEFINST Rule ("LESC@8BP")
	 (source "	IF (ISA realLocation $Consumer) truck:cargo
	THEN .SellGoods;")
	 (edited " 5-JUL-83 11:58:34")
	 (editor MITTAL)
	 (ruleNumber 7)
	 (ruleSet #&(RuleSet "FRSC@$PA")))



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

"	(* Rules for deciding how much the Peddler 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 " 9-JUN-83 22:34:09")
	 (editor STEFIK)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "FRSC@$TR")))



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

"   
-> volumeLimit ← volumeCapacity / roadStop::Commodity::VolPerQty
   weightLimit ← weightCapacity / roadStop::Commodity::WtPerQty
   cashLimit ← cashCapacity / (PricePerUnit roadStop)
   producerLimit ← roadStop:qty;")
	 (edited " 9-JUN-83 22:34:09")
	 (editor STEFIK)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "FRSC@$TR")))



(DEFINST Rule ("UISC@AMV")
	 (source "-> numBuy ← (MIN volumeLimit weightLimit cashLimit producerLimit);")
	 (edited " 9-JUN-83 22:34:09")
	 (editor STEFIK)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "FRSC@$TR")))



(DEFINST Rule ("UISC@<{l")
	 (source "-> numBuy ← (MIN volumeLimit weightLimit cashLimit producerLimit);")
	 (edited " 9-JUN-83 17:59:43")
	 (editor BOBROW)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "FRSC@$TR")))



[DEFINST Rule ("FBS@@A?V")
	 (source NIL)
	 (edited " 2-FEB-83 14:52:17")
	 (editor "LOOPSCOURSE")
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "FAS@@&Lh"))
	 (lhs (GREATERP qtyLimit 0))
	 (rhs (SETQ ↑value (PROGN (PROGN                     (* Make an audit record for this rule and set its audit 
							     values.)
					 (SETQ ↑auditRecord (← (GetObjFromUID "FAS@@<\")
							       NewTemp))
					 (PutValue ↑auditRecord (QUOTE rule)
						   (GetObjFromUID "FBS@@A?V")))
				  (← gameMaster Buy qtyLimit)
				  (PutAuditRec self (QUOTE goal)
					       (QUOTE Sell)
					       ↑auditRecord)
				  (PutAuditRec self (QUOTE destination)
					       (NearestRoadStop (Buyers commodity))
					       ↑auditRecord)
				  (PutAuditRec self (QUOTE direction)
					       (DirectionOf (GetValue self (QUOTE destination)))
					       ↑auditRecord]



(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 ("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 ("LNS.0.5349.46.57775.172")
	 (source "	(* Rate the suitability of a proposed Producer.)
-> rating ← 0;")
	 (edited "15-JUL-83 12:47:38")
	 (editor BENSON)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "LNS.0.5349.46.57775.61")))



(DEFINST Rule ("LNS.0.5349.46.57775.173")
	 (source "(* Need to be able to park)
IF ~(RoomToParkP roadStop)
 THEN rating ← -500;")
	 (edited "15-JUL-83 12:47:38")
	 (editor BENSON)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "LNS.0.5349.46.57775.61")))



(DEFINST Rule ("LNS.0.5349.46.57775.174")
	 (source 

"(* Exclude perishables.)
 IF (SUBCLASS roadStop::Commodity $PerishableCommodity)
  THEN rating ← -50000;")
	 (edited "15-JUL-83 12:47:38")
	 (editor BENSON)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "LNS.0.5349.46.57775.61")))



(DEFINST Rule ("LNS.0.5349.46.57775.175")
	 (source "(* Exclude gas stations.)
 IF (ISA roadStop $GasStation)
  THEN rating ← -100000;")
	 (edited "15-JUL-83 12:47:38")
	 (editor BENSON)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "LNS.0.5349.46.57775.61")))



(DEFINST Rule ("LNS.0.5349.46.57775.176")
	 (source 
	 "(* Exclude producers that are sold out.)
 IF roadStop:qty < 1
  THEN rating ← -100000;")
	 (edited "15-JUL-83 12:47:38")
	 (editor BENSON)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "LNS.0.5349.46.57775.61")))



(DEFINST Rule ("LNS.0.5349.46.57775.177")
	 (source 

"(* Exclude excessively fragile goods.)
 IF (SUBCLASS roadStop::Commodity $FragileCommodity)  
  THEN rating ← rating - [500 * roadStop::Commodity::FragilityLevel];")
	 (edited "15-JUL-83 12:47:38")
	 (editor BENSON)
	 (ruleNumber 6)
	 (ruleSet #&(RuleSet "LNS.0.5349.46.57775.61")))



(DEFINST Rule ("LNS.0.5349.46.57775.178")
	 (source 

"(* Favor high expected profit)
IF possibleConsumer←(NearestRoadStop
                      (Buyers roadStop::Commodity))
   maxBuy ← (← self MaxPurchase roadStop)
   expPr ← possibleConsumer:pr
   expProfit ← [expPr - roadStop:pr] * roadStop::Commodity::AvgPrice * maxBuy
THEN rating ← rating + expProfit;")
	 (edited "15-JUL-83 12:47:38")
	 (editor BENSON)
	 (ruleNumber 7)
	 (ruleSet #&(RuleSet "LNS.0.5349.46.57775.61")))



(DEFINST Rule ("LNS.0.5349.46.57775.179")
	 (source 
 "(* Favor close places)
-> rating ← rating - [truck::Gpm * (Distance roadStop truck:location)];")
	 (edited "15-JUL-83 12:47:38")
	 (editor BENSON)
	 (ruleNumber 8)
	 (ruleSet #&(RuleSet "LNS.0.5349.46.57775.61")))



(DEFINST Rule ("LNS.0.5349.46.57775.180")
	 (source 

"(* Favor high expected profit)
IF possibleConsumers←(Buyers roadStop::Commodity)
   expPr ← (PickHiObj self 'SelectPr possibleConsumers)
   expProfit ← [expPr - roadStop:pr] * roadStop::Commodity::AvgPrice * maxBuy
THEN rating ← rating + expProfit;")
	 (edited "15-JUL-83 09:47:06")
	 (editor BENSON)
	 (ruleNumber 9)
	 (ruleSet #&(RuleSet "LNS.0.5349.46.57775.61")))



(DEFINST Rule ("LNS.0.5349.46.57775.181")
	 (source 
 "(* Favor close places)
-> rating ← rating - [truck::Gpm * (Distance roadStop truck:location)];")
	 (edited "15-JUL-83 09:47:06")
	 (editor BENSON)
	 (ruleNumber 10)
	 (ruleSet #&(RuleSet "LNS.0.5349.46.57775.61")))



(DEFINST Rule ("UISC@AMi")
	 (source 
"(* Favor close places.)
  -> rating ← rating - [truck::Gpm * (Distance roadStop truck:location)];")
	 (edited " 9-JUN-83 22:37:28")
	 (editor STEFIK)
	 (ruleNumber 11)
	 (ruleSet #&(RuleSet "FRSC@$Qy")))



(DEFINST Rule ("FYSC@}d")
	 (source 

"(* Favor close places.)
  -> rating ← rating - [currentPlayer:truck::Gpm * (Distance self currentPlayer:truck:location)];")
	 (edited "25-FEB-83 10:39:58")
	 (editor MITTAL)
	 (ruleNumber)
	 (ruleSet #&(RuleSet "FRSC@$Qy")))



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

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

-> cargo ← (CAR truck:cargo);")
	 (edited " 9-JUN-83 22:03:23")
	 (editor STEFIK)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "FRSC@$PR")))



(DEFINST Rule ("UISC@AMk")
	 (source 
	"   (* Favor places closer to Alices.)
-> rating ← 100 - 4 * (Distance roadStop alices);")
	 (edited " 9-JUN-83 22:03:23")
	 (editor STEFIK)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "FRSC@$PR")))



(DEFINST Rule ("UISC@AMl")
	 (source "IF ~(RoomToParkP roadStop)
 THEN rating ← -1000;")
	 (edited " 9-JUN-83 22:03:23")
	 (editor STEFIK)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "FRSC@$PR")))



(DEFINST Rule ("UISC@AMm")
	 (source "IF (ISA roadStop $UnionHall)
 THEN rating ← -1000;")
	 (edited " 9-JUN-83 22:03:23")
	 (editor STEFIK)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "FRSC@$PR")))



(DEFINST Rule ("UISC@AMn")
	 (source "IF (ISA roadStop $AlicesRestaurant)
 THEN rating ← -500;")
	 (edited " 9-JUN-83 22:03:23")
	 (editor STEFIK)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "FRSC@$PR")))



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

"IF cargo (ISA roadStop $Consumer) (ISA cargo roadStop::Commodity)
   roadStop:qty>0 roadStop:pr>1
 THEN rating ← rating + 20;")
	 (edited " 9-JUN-83 22:03:23")
	 (editor STEFIK)
	 (ruleNumber 6)
	 (ruleSet #&(RuleSet "FRSC@$PR")))



(DEFINST Rule ("LESC@8BQ")
	 (source "	-> cargo←(CAR truck:cargo);")
	 (edited " 5-JUL-83 11:57:52")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "FRSC@$PC")))



(DEFINST Rule ("LESC@8BR")
	 (source 
	 "	IF ~(ISA cargo truck:location::Commodity)
	THEN (STOP NIL 'NoSale 'WrongKindOfBuyer);")
	 (edited " 5-JUL-83 11:57:52")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "FRSC@$PC")))



(DEFINST Rule ("LESC@8BS")
	 (source 
	  "	IF truck:location:pr < 1.1 goal='Peddle 
	THEN (STOP NIL 'NoSale 'AvoidCheapSkates);")
	 (edited " 5-JUL-83 11:57:52")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "FRSC@$PC")))



(DEFINST Rule ("LESC@8BT")
	 (source "	IF truck:location:pr < 0 
	THEN (STOP NIL 'NoSale 'NeverSellAtLoss);")
	 (edited " 5-JUL-83 11:57:52")
	 (editor MITTAL)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "FRSC@$PC")))



(DEFINST Rule ("LESC@8BU")
	 (source 

"(* Make sale as limited by cargo and consumer.)

IF ~cargo:status (ISA truck:location $CityDump)
THEN sellQty←(MIN truck:location:qty cargo:qty) 
     (← \PlayerInterface Sell self cargo sellQty)
     (STOP T 'Sold 'AtCityDump);")
	 (edited " 5-JUL-83 11:57:52")
	 (editor MITTAL)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "FRSC@$PC")))



(DEFINST Rule ("LESC@8BV")
	 (source 

"	IF cargo:status sellQty←(MIN truck:location:qty cargo:qty) sellQty>=1 
	THEN (← \PlayerInterface Sell self cargo sellQty);")
	 (edited " 5-JUL-83 11:57:52")
	 (editor MITTAL)
	 (ruleNumber 6)
	 (ruleSet #&(RuleSet "FRSC@$PC")))



[DEFINST Rule ("FBS@@A?b")
	 (source NIL)
	 (edited " 2-FEB-83 14:52:20")
	 (editor "LOOPSCOURSE")
	 (ruleNumber 7)
	 (ruleSet #&(RuleSet "FAS@@&Lr"))
	 (lhs (AND (PROGN                                    (* Rule Tracing Code)
			  (TraceLHS NIL 7)
			  (← (GetObjFromUID "FBS@@A?b")
			     Print))
		   (EQ cQty sellQty)))
	 (rhs (SETQ ↑value (PROGN (PROGN                     (* Make an audit record for this rule and set its audit 
							     values.)
					 (SETQ ↑auditRecord (← (GetObjFromUID "FAS@@<\")
							       NewTemp))
					 (PutValue ↑auditRecord (QUOTE rule)
						   (GetObjFromUID "FBS@@A?b")))
				  (PROGN                     (* Rule Tracing Code)
					 (TraceRHS NIL 7)
					 (← (GetObjFromUID "FBS@@A?b")
					    Print))
				  (PutAuditRec self (QUOTE goal)
					       (QUOTE Buy)
					       ↑auditRecord)
				  (PutAuditRec self (QUOTE destination)
					       NIL ↑auditRecord]



[DEFINST Rule ("FBS@@A?c")
	 (source NIL)
	 (edited " 2-FEB-83 14:52:20")
	 (editor "LOOPSCOURSE")
	 (ruleNumber 8)
	 (ruleSet #&(RuleSet "FAS@@&Lr"))
	 (lhs (AND (PROGN                                    (* Rule Tracing Code)
			  (TraceLHS NIL 8)
			  (← (GetObjFromUID "FBS@@A?c")
			     Print))
		   (LESSP sellQty cQty)))
	 (rhs (SETQ ↑value (PROGN (PROGN                     (* Make an audit record for this rule and set its audit 
							     values.)
					 (SETQ ↑auditRecord (← (GetObjFromUID "FAS@@<\")
							       NewTemp))
					 (PutValue ↑auditRecord (QUOTE rule)
						   (GetObjFromUID "FBS@@A?c")))
				  (PROGN                     (* Rule Tracing Code)
					 (TraceRHS NIL 8)
					 (← (GetObjFromUID "FBS@@A?c")
					    Print))
				  (PutAuditRec self (QUOTE destination)
					       (NearestRoadStop (Buyers cargo1))
					       ↑auditRecord)
				  (PutAuditRec self (QUOTE direction)
					       (DirectionOf (GetValue self (QUOTE destination)))
					       ↑auditRecord]



(DEFINST Rule ("LESC@8B>")
	 (source 

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

 IF ~goal
  THEN goal←'Peddle;")
	 (edited " 5-JUL-83 12:00:00")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "YQSC@<?t")))



(DEFINST Rule ("LESC@8B?")
	 (source 

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



(DEFINST Rule ("LESC@8B@")
	 (source 

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



(DEFINST Rule ("LESC@8BA")
	 (source 

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



(DEFINST Rule ("LESC@8BB")
	 (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 " 5-JUL-83 12:00:00")
	 (editor MITTAL)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "YQSC@<?t")))



(DEFINST Rule ("LESC@8BC")
	 (source 

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



(DEFINST Rule ("LESC@8BD")
	 (source 

"(* Go to Alices now that it is time)
 IF \Simulator:timeLeft < 30 
    ~(ISA truck:location $AlicesRestaurant)   
  THEN destination← (NearestRoadStop (RoadStops $AlicesRestaurant))
       goal←'GoToAlices ;")
	 (edited " 5-JUL-83 12:00:00")
	 (editor MITTAL)
	 (ruleNumber 7)
	 (ruleSet #&(RuleSet "YQSC@<?t")))



(DEFINST Rule ("LESC@8BW")
	 (source 

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



(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 (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 (PeddlerMaxPurchase "FRSC@$TR")
	 (perspectiveNode #&(RuleSetNode "FRSC@$T←") myViewName RuleSet)
	 (name #(PeddlerMaxPurchase NIL RememberName))
	 (compiledRules PeddlerMaxPurchase)
	 (workSpace Peddler)
	 (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)
	 (arguments))



(DEFINST RuleSet (BuyGoodsToyotaRules "FAS@@&Lh")
	 (perspectiveNode #&(RuleSetNode "FAS@@&Mg") myViewName RuleSet)
	 (name #(BuyGoodsToyotaRules NIL RememberName))
	 (compiledRules BuyGoodsToyotaRules)
	 (workSpace Toyota)
	 (args)
	 (tempVars (commodity volumeCapacity weightCapacity volumeLimit weightLimit cashLimit 
			      producerLimit numBuy))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 4)
	 (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 (PeddlerRateProducers "FRSC@$Qy")
	 (perspectiveNode #&(RuleSetNode "FRSC@$Rf") myViewName RuleSet)
	 (name #(PeddlerRateProducers NIL RememberName))
	 (compiledRules PeddlerRateProducers)
	 (workSpace Peddler)
	 (args (roadStop))
	 (tempVars (rating maxBuy))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 11)
	 (controlStructure DOALL)
	 (whileCondition NIL)
	 (compilerOptions NIL)
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass)
	 (arguments))



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



(DEFINST RuleSet (SellGoodsPeddlerRules "FRSC@$PC")
	 (perspectiveNode #&(RuleSetNode "FRSC@$PH") myViewName RuleSet)
	 (name #(SellGoodsPeddlerRules NIL RememberName))
	 (compiledRules SellGoodsPeddlerRules)
	 (workSpace Peddler)
	 (args NIL)
	 (tempVars (cargo sellQty))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 6)
	 (controlStructure DOALL)
	 (whileCondition NIL)
	 (compilerOptions (A))
	 (auditClass NIL)
	 (metaAssignments NIL)
	 (ruleClass NIL)
	 (taskClass)
	 (arguments))



(DEFINST RuleSet (SellGoodsToyotaRules "FAS@@&Lr")
	 (perspectiveNode #&(RuleSetNode "FAS@@&Mj") myViewName RuleSet)
	 (name #(SellGoodsToyotaRules NIL RememberName))
	 (compiledRules SellGoodsToyotaRules)
	 (workSpace Toyota)
	 (args)
	 (tempVars (cargo sellQty))
	 (taskVars NIL)
	 (debugVars NIL)
	 (numRules 4)
	 (controlStructure DOALL)
	 (whileCondition NIL)
	 (compilerOptions NIL)
	 (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@$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@$PG")
	 (perspectives ? RuleSet #&(RuleSet "FRSC@$PA") Source #&(RuleSetSource "FRSC@$PL")))



(DEFINST RuleSetNode ("FRSC@$T←")
	 (perspectives ? RuleSet #&(RuleSet "FRSC@$TR") Source #&(RuleSetSource "FRSC@$T`")))



(DEFINST RuleSetNode ("FAS@@&Mg")
	 (perspectives ? RuleSet #&(RuleSet "FAS@@&Lh") Source #&(RuleSetSource "FAS@@&Mm")))



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



(DEFINST RuleSetNode ("FRSC@$Rf")
	 (perspectives ? RuleSet #&(RuleSet "FRSC@$Qy") Source #&(RuleSetSource "FRSC@$Rp")))



(DEFINST RuleSetNode ("FRSC@$PY")
	 (perspectives ? RuleSet #&(RuleSet "FRSC@$PR") Source #&(RuleSetSource "FRSC@$P[")))



(DEFINST RuleSetNode ("FRSC@$PH")
	 (perspectives ? RuleSet #&(RuleSet "FRSC@$PC") Source #&(RuleSetSource "FRSC@$PM")))



(DEFINST RuleSetNode ("FAS@@&Mj")
	 (perspectives ? RuleSet #&(RuleSet "FAS@@&Lr") Source #&(RuleSetSource "FAS@@&Mp")))



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



(DEFINST RuleSetSource ("FRSC@$PK")
	 (indexedVars ((#&(Rule "LESC@8BE"))
		       (#&(Rule "LESC@8BF"))
		       (#&(Rule "LESC@8BG"))
		       (#&(Rule "LESC@8BH"))
		       (#&(Rule "LESC@8BI"))
		       (#&(Rule "LESC@8BJ"))
		       (#&(Rule "FAS@@&Lp"))))
	 (perspectiveNode #&(RuleSetNode "FRSC@$PF") myViewName Source)
	 (created " 1-FEB-83 14:25:23")
	 (creator LOOPSCOURSE)
	 (edited " 5-JUL-83 12:01:40")
	 (editor MITTAL))



(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@$PL")
	 (indexedVars ((#&(Rule "LESC@8B"))
		       (#&(Rule "LESC@8BK"))
		       (#&(Rule "LESC@8BL"))
		       (#&(Rule "LESC@8BM"))
		       (#&(Rule "LESC@8BN"))
		       (#&(Rule "LESC@8BO"))
		       (#&(Rule "LESC@8BP"))))
	 (perspectiveNode #&(RuleSetNode "FRSC@$PG") myViewName Source)
	 (created " 1-FEB-83 14:25:34")
	 (creator LOOPSCOURSE)
	 (edited " 5-JUL-83 11:58:34")
	 (editor MITTAL))



(DEFINST RuleSetSource ("FRSC@$T`")
	 (indexedVars ((#&(Rule "UISC@AMT"))
		       (#&(Rule "UISC@AMU"))
		       (#&(Rule "UISC@AMV"))
		       (#&(Rule "UISC@<{l"))
		       (#&(Rule "FBS@@A?V"))))
	 (perspectiveNode #&(RuleSetNode "FRSC@$T←") myViewName Source)
	 (created " 1-FEB-83 14:25:11")
	 (creator LOOPSCOURSE)
	 (edited " 9-JUN-83 22:34:09")
	 (editor STEFIK))



(DEFINST RuleSetSource ("FAS@@&Mm")
	 (indexedVars ((#&(Rule "FPSC@$Ls"))
		       (#&(Rule "FPSC@$Lt"))
		       (#&(Rule "FPSC@$Lu"))
		       (#&(Rule "FPSC@$Lv"))
		       (#&(Rule "FBS@@A?V"))))
	 (perspectiveNode #&(RuleSetNode "FAS@@&Mg") myViewName Source)
	 (created " 1-FEB-83 14:25:11")
	 (creator LOOPSCOURSE)
	 (edited "16-FEB-83 14:59:42")
	 (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 ("FRSC@$Rp")
	 (indexedVars ((#&(Rule "UISC@AM←"))
		       (#&(Rule "UISC@AM`"))
		       (#&(Rule "UISC@AMa"))
		       (#&(Rule "UISC@AMb"))
		       (#&(Rule "UISC@AMc"))
		       (#&(Rule "UISC@AMd"))
		       (#&(Rule "UISC@AMe"))
		       (#&(Rule "UISC@AMf"))
		       (#&(Rule "UISC@AMg"))
		       (#&(Rule "UISC@AMh"))
		       (#&(Rule "UISC@AMi"))
		       (#&(Rule "FYSC@}d"))))
	 (perspectiveNode #&(RuleSetNode "FRSC@$Rf") myViewName Source)
	 (created "18-FEB-83 22:45:14")
	 (creator STEFIK)
	 (edited " 9-JUN-83 22:37:28")
	 (editor STEFIK))



(DEFINST RuleSetSource ("FRSC@$P[")
	 (indexedVars ((#&(Rule "UISC@AMj"))
		       (#&(Rule "UISC@AMk"))
		       (#&(Rule "UISC@AMl"))
		       (#&(Rule "UISC@AMm"))
		       (#&(Rule "UISC@AMn"))
		       (#&(Rule "UISC@AMo"))))
	 (perspectiveNode #&(RuleSetNode "FRSC@$PY") myViewName Source)
	 (created "18-FEB-83 20:41:23")
	 (creator STEFIK)
	 (edited " 9-JUN-83 22:03:23")
	 (editor STEFIK))



(DEFINST RuleSetSource ("FRSC@$PM")
	 (indexedVars ((#&(Rule "LESC@8BQ"))
		       (#&(Rule "LESC@8BR"))
		       (#&(Rule "LESC@8BS"))
		       (#&(Rule "LESC@8BT"))
		       (#&(Rule "LESC@8BU"))
		       (#&(Rule "LESC@8BV"))
		       (#&(Rule "FBS@@A?b"))
		       (#&(Rule "FBS@@A?c"))))
	 (perspectiveNode #&(RuleSetNode "FRSC@$PH") myViewName Source)
	 (created " 1-FEB-83 14:25:40")
	 (creator LOOPSCOURSE)
	 (edited " 5-JUL-83 11:57:52")
	 (editor MITTAL))



(DEFINST RuleSetSource ("FAS@@&Mp")
	 (indexedVars ((#&(Rule "FPSC@$MD"))
		       (#&(Rule "FPSC@$ME"))
		       (#&(Rule "FPSC@$MF"))
		       (#&(Rule "FPSC@$MG"))
		       (#&(Rule "FBS@@A?`"))
		       (#&(Rule "FBS@@A?a"))
		       (#&(Rule "FBS@@A?b"))
		       (#&(Rule "FBS@@A?c"))))
	 (perspectiveNode #&(RuleSetNode "FAS@@&Mj") myViewName Source)
	 (created " 1-FEB-83 14:25:40")
	 (creator LOOPSCOURSE)
	 (edited "16-FEB-83 14:26:24")
	 (editor STEFIK))



(DEFINST RuleSetSource ("YQSC@<@J")
	 (indexedVars ((#&(Rule "LESC@8B>"))
		       (#&(Rule "LESC@8B?"))
		       (#&(Rule "LESC@8B@"))
		       (#&(Rule "LESC@8BA"))
		       (#&(Rule "LESC@8BB"))
		       (#&(Rule "LESC@8BC"))
		       (#&(Rule "LESC@8BD"))
		       (#&(Rule "LESC@8BW"))))
	 (perspectiveNode #&(RuleSetNode "YQSC@<@I") myViewName Source)
	 (created " 1-FEB-83 14:25:51")
	 (creator LOOPSCOURSE)
	 (edited " 5-JUL-83 12:00:00")
	 (editor MITTAL))



(DEFINST Rule ("LESC@8BE")
	 (source 

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

IF truck:fuel=0
THEN stoppingPlace←(AnyRoadStop $UnionHall);")
	 (edited " 5-JUL-83 12:01:40")
	 (editor MITTAL)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "FRSC@$Oz")))



(DEFINST Rule ("LESC@8BF")
	 (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 " 5-JUL-83 12:01:40")
	 (editor MITTAL)
	 (ruleNumber 2)
	 (ruleSet #&(RuleSet "FRSC@$Oz")))



(DEFINST Rule ("LESC@8BG")
	 (source 

"(* Obey the law - stop at WeighStations.)
IF wStation←(NearestRoadStop (RoadStops $WeighStation .Range1 direction 'Room))
   (Distance wStation)<(Distance destination) 
THEN stoppingPlace←wStation;")
	 (edited " 5-JUL-83 12:01:40")
	 (editor MITTAL)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "FRSC@$Oz")))



(DEFINST Rule ("LESC@8BH")
	 (source 
   "IF (Distance destination)<=.Range1 (RoomToParkP destination)
THEN stoppingPlace←destination;")
	 (edited " 5-JUL-83 12:01:40")
	 (editor MITTAL)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "FRSC@$Oz")))



(DEFINST Rule ("LESC@8BI")
	 (source 

"IF gasStation←(FurthestRoadStop (RoadStops $GasStation .Range1 direction 'Room))
   gasStation:qty>0
THEN stoppingPlace←gasStation;")
	 (edited " 5-JUL-83 12:01:40")
	 (editor MITTAL)
	 (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 ("FPSC@$Ls")
	 (source 
   "	(* Rules for deciding what and how much to buy.)

-> commodity ←	truck:location::Commodity;")
	 (edited "16-FEB-83 14:59:42")
	 (editor STEFIK)
	 (ruleNumber)
	 (ruleSet #&(RuleSet "FAS@@&Lh")))



(DEFINST Rule ("FPSC@$Lt")
	 (source "IF ~(ISA commodity $LuxuryGoods)
THEN (STOP NIL 'NoBuy 'NotLuxury);")
	 (edited "16-FEB-83 14:59:42")
	 (editor STEFIK)
	 (ruleNumber)
	 (ruleSet #&(RuleSet "FAS@@&Lh")))



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

"(* Sale can be limited by volume, weight, cash, or availability.)
-> volumeCapacity ← truck::MaxVolume-truck:volume
   weightCapacity ← truck::MaxWeight-truck:weight   
   volumeLimit ← volumeCapacity / commodity::VolPerQty
   weightLimit ← weightCapacity / commodity::WtPerQty
   cashLimit ← truck:cashBox / (PricePerUnit truck:location)
   producerLimit ← truck:location:qty
   numBuy ← (MIN volumeLimit weightLimit cashLimit producerLimit);")
	 (edited "16-FEB-83 14:59:42")
	 (editor STEFIK)
	 (ruleNumber)
	 (ruleSet #&(RuleSet "FAS@@&Lh")))



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

"(* Buy as much as possible, then decide to sell it.)
IF numBuy>0
THEN (← gameMaster Buy numBuy)
     goal←'Sell
     destination←(NearestRoadStop (Buyers commodity));")
	 (edited "16-FEB-83 14:59:42")
	 (editor STEFIK)
	 (ruleNumber)
	 (ruleSet #&(RuleSet "FAS@@&Lh")))



(DEFINST Rule ("UISC@AM←")
	 (source "	(* Rate the suitability of a proposed Producer.)
-> rating ← 0;")
	 (edited " 9-JUN-83 22:37:28")
	 (editor STEFIK)
	 (ruleNumber 1)
	 (ruleSet #&(RuleSet "FRSC@$Qy")))



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



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

"(* Exclude perishables.)
 IF (SUBCLASS roadStop::Commodity $PerishableCommodity)
  THEN rating ← -50000;")
	 (edited " 9-JUN-83 22:37:28")
	 (editor STEFIK)
	 (ruleNumber 3)
	 (ruleSet #&(RuleSet "FRSC@$Qy")))



(DEFINST Rule ("UISC@AMb")
	 (source "(* Exclude gas stations.)
 IF (ISA roadStop $GasStation)
  THEN rating ← -100000;")
	 (edited " 9-JUN-83 22:37:28")
	 (editor STEFIK)
	 (ruleNumber 4)
	 (ruleSet #&(RuleSet "FRSC@$Qy")))



(DEFINST Rule ("UISC@AMc")
	 (source 
	 "(* Exclude producers that are sold out.)
 IF roadStop:qty < 1
  THEN rating ← -100000;")
	 (edited " 9-JUN-83 22:37:28")
	 (editor STEFIK)
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "FRSC@$Qy")))



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

"(* Exclude excessively fragile goods.)
 IF (SUBCLASS roadStop::Commodity $FragileCommodity)  
  THEN rating ← rating - [500 * roadStop::Commodity::FragilityLevel];")
	 (edited " 9-JUN-83 22:37:28")
	 (editor STEFIK)
	 (ruleNumber 6)
	 (ruleSet #&(RuleSet "FRSC@$Qy")))



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

"(* Penalize producers for which can buy < 2 items.)
 IF maxBuy←(← self MaxPurchase roadStop) maxBuy < 1
  THEN rating ← rating - 10000;")
	 (edited " 9-JUN-83 22:37:28")
	 (editor STEFIK)
	 (ruleNumber 7)
	 (ruleSet #&(RuleSet "FRSC@$Qy")))



(DEFINST Rule ("UISC@AMf")
	 (source 
"(* favor LuxuryGoods)
IF (SUBCLASS roadStop::Commodity $LuxuryGoods)
THEN rating ← rating + 200;")
	 (edited " 9-JUN-83 22:37:28")
	 (editor STEFIK)
	 (ruleNumber 8)
	 (ruleSet #&(RuleSet "FRSC@$Qy")))



(DEFINST Rule ("UISC@AMg")
	 (source "(* favor higher qty)
 -> rating ← rating + 10 * maxBuy;")
	 (edited " 9-JUN-83 22:37:28")
	 (editor STEFIK)
	 (ruleNumber 9)
	 (ruleSet #&(RuleSet "FRSC@$Qy")))



(DEFINST Rule ("UISC@AMh")
	 (source "(* Favor low price ratios.)
  -> rating ← rating + 100 * [2 - roadStop:pr];")
	 (edited " 9-JUN-83 22:37:28")
	 (editor STEFIK)
	 (ruleNumber 10)
	 (ruleSet #&(RuleSet "FRSC@$Qy")))



(DEFINST Rule ("FPSC@$MD")
	 (source "	-> cargo←(CAR truck:cargo);")
	 (edited "16-FEB-83 14:26:24")
	 (editor STEFIK)
	 (ruleNumber)
	 (ruleSet #&(RuleSet "FAS@@&Lr")))



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

"(* Abort sale if cargo has disappeared.)
	IF ~cargo
	THEN destination←NIL
	(WriteGameStatus %"Yipes! My cargo is gone!%")
	(STOP NIL 'NoSale 'NoCargo);")
	 (edited "16-FEB-83 14:26:24")
	 (editor STEFIK)
	 (ruleNumber)
	 (ruleSet #&(RuleSet "FAS@@&Lr")))



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

"(* Make sale as limited by cargo and consumer.)

	IF sellQty←(MIN truck:location:qty cargo:qty) sellQty>0 
	THEN (← gameMaster Sell cargo sellQty);")
	 (edited "16-FEB-83 14:26:24")
	 (editor STEFIK)
	 (ruleNumber)
	 (ruleSet #&(RuleSet "FAS@@&Lr")))



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

"(* Find another buyer if all not sold.)

	IF cargo←(CAR truck:cargo) cargo:qty>0
	THEN destination←(NearestRoadStop (Buyers truck:cargo))
	     direction←(DirectionOf destination)
	     (STOP NIL 'NoSale 'CantSell);")
	 (edited "16-FEB-83 14:26:24")
	 (editor STEFIK)
	 (ruleNumber)
	 (ruleSet #&(RuleSet "FAS@@&Lr")))



[DEFINST Rule ("FBS@@A?`")
	 (source NIL)
	 (edited " 2-FEB-83 14:52:20")
	 (editor "LOOPSCOURSE")
	 (ruleNumber 5)
	 (ruleSet #&(RuleSet "FAS@@&Lr"))
	 [lhs (AND (PROGN                                    (* Rule Tracing Code)
			  (TraceLHS NIL 5)
			  (← (GetObjFromUID "FBS@@A?`")
			     Print))
		   (OR (EQ sellQty 0)
		       (NOT (ISA cargo1 commodity]
	 (rhs (SETQ ↑value (PROGN (PROGN                     (* Make an audit record for this rule and set its audit 
							     values.)
					 (SETQ ↑auditRecord (← (GetObjFromUID "FAS@@<\")
							       NewTemp))
					 (PutValue ↑auditRecord (QUOTE rule)
						   (GetObjFromUID "FBS@@A?`")))
				  (PROGN                     (* Rule Tracing Code)
					 (TraceRHS NIL 5)
					 (← (GetObjFromUID "FBS@@A?`")
					    Print))
				  (PutAuditRec self (QUOTE destination)
					       (NearestRoadStop (Buyers cargo1))
					       ↑auditRecord)
				  (PutAuditRec self (QUOTE direction)
					       (DirectionOf (GetValue self (QUOTE destination)))
					       ↑auditRecord)
				  (PROGN                     (* ↑value set by RuleSetStop)
					 (RuleSetStop self)
					 (GO QUIT]



[DEFINST Rule ("FBS@@A?a")
	 (source NIL)
	 (edited " 2-FEB-83 14:52:20")
	 (editor "LOOPSCOURSE")
	 (ruleNumber 6)
	 (ruleSet #&(RuleSet "FAS@@&Lr"))
	 (lhs (PROGN                                         (* Rule Tracing Code)
		     (TraceLHS NIL 6)
		     (← (GetObjFromUID "FBS@@A?a")
			Print)))
	 (rhs (SETQ ↑value (PROGN (PROGN                     (* Rule Tracing Code)
					 (TraceRHS NIL 6)
					 (← (GetObjFromUID "FBS@@A?a")
					    Print))
				  (← gameMaster Sell cargo1 sellQty]



(DEFINEQ

(FindStoppingPlaceTeamsterRules
  [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 "LNS.0.5349.46.57775.71")))
				  (PutAuditRec self (QUOTE stoppingPlace)
					       (AnyRoadStop ($ UnionHall))
					       ↑auditRecord]
	    [[AND (NEQ (GetValue self (QUOTE goal))
		       (QUOTE SitTight))
		  [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 gasStation (NearestRoadStop (RoadStops ($ GasStation)
							       (← self Range1)
							       (GetValue self (QUOTE direction))
							       (QUOTE Room]
	      (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 "LNS.0.5349.46.57775.72")))
				  (PutAuditRec self (QUOTE stoppingPlace)
					       gasStation ↑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 "LNS.0.5349.46.57775.73")))
				  (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 "LNS.0.5349.46.57775.74")))
				  (PutAuditRec self (QUOTE stoppingPlace)
					       (GetValue self (QUOTE destination))
					       ↑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 "LNS.0.5349.46.57775.75")))
				   (PutAuditRec self (QUOTE stoppingPlace)
						(NthRoadStop (GetValue self (QUOTE maxMove))
							     (GetValue self (QUOTE direction))
							     NIL
							     (QUOTE Room))
						↑auditRecord]
      QUIT(RETURN ↑value])

(GetPriceRatio
  [LAMBDA (self roadStop)
    (PROG (↑value priceRatio)
          [SETQ ↑value (SETQ priceRatio (GetValue roadStop (QUOTE pr]
      QUIT(RETURN ↑value])

(GoToStoppingPlaceTeamsterRules
  [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 "LNS.0.5349.46.57775.59")))
			      (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 reach stoppingPlace"]
          [COND
	    ((ISA realLocation ($ GasStation))
	      (SETQ ↑value (← self BuyGas]
          [COND
	    ((AND (ISA realLocation ($ Producer))
		  (NOT (ISA realLocation ($ GasStation)))
		  (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]
      QUIT(RETURN ↑value])

(MaxPurchaseTeamsterRules
  [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])

(RateConsumersTeamsterRules
  [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
	    ((AND (NOT (GetValue cargo (QUOTE status)))
		  (ISA roadStop ($ 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 roadStop (QUOTE Commodity]
	      (SETQ ↑value (SETQ rating (DIFFERENCE rating 5000]
          [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])

(RateProducersTeamsterRules
  [LAMBDA (self roadStop)
    (PROG (↑value rating maxBuy possibleConsumer expPr expProfit)
          (SETQ ↑value (SETQ rating 0))
          [COND
	    ((NOT (RoomToParkP roadStop))
	      (SETQ ↑value (SETQ rating (MINUS 500]
          [COND
	    ((SUBCLASS (GetClassValue roadStop (QUOTE Commodity))
		       ($ PerishableCommodity))
	      (SETQ ↑value (SETQ rating (MINUS 50000]
          [COND
	    ((ISA roadStop ($ GasStation))
	      (SETQ ↑value (SETQ rating (MINUS 100000]
          [COND
	    ((LESSP (GetValue roadStop (QUOTE qty))
		    1)
	      (SETQ ↑value (SETQ rating (MINUS 100000]
          [COND
	    ((SUBCLASS (GetClassValue roadStop (QUOTE Commodity))
		       ($ FragileCommodity))
	      (SETQ ↑value (SETQ rating (DIFFERENCE rating (TIMES 500 (GetClassValue
								    (GetClassValue roadStop
										   (QUOTE Commodity))
								    (QUOTE FragilityLevel]
          [COND
	    ((AND [SETQ possibleConsumer (NearestRoadStop (Buyers (GetClassValue roadStop
										 (QUOTE Commodity]
		  (SETQ maxBuy (← self MaxPurchase roadStop))
		  (SETQ expPr (GetValue possibleConsumer (QUOTE pr)))
		  (SETQ expProfit (TIMES (TIMES (DIFFERENCE expPr (GetValue roadStop (QUOTE pr)))
						(GetClassValue (GetClassValue roadStop (QUOTE 
											Commodity))
							       (QUOTE AvgPrice)))
					 maxBuy)))
	      (SETQ ↑value (SETQ rating (PLUS rating expProfit]
          [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])

(RateSpotsNearAlicesTeamsterRules
  [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])

(SellGoodsTeamsterRules
  [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 (LESSP (GetValue (GetValue (GetValue self (QUOTE truck))
					     (QUOTE location))
				   (QUOTE pr))
			 1.1)
		  (EQ (GetValue self (QUOTE goal))
		      (QUOTE Peddle)))
	      (SETQ ↑value (PROGN                            (* ↑value set by RuleSetStop)
				  (RuleSetStop NIL (QUOTE NoSale)
					       (QUOTE AvoidCheapSkates))
				  (GO QUIT]
          [COND
	    ((LESSP (GetValue (GetValue (GetValue self (QUOTE truck))
					(QUOTE location))
			      (QUOTE pr))
		    0)
	      (SETQ ↑value (PROGN                            (* ↑value set by RuleSetStop)
				  (RuleSetStop NIL (QUOTE NoSale)
					       (QUOTE NeverSellAtLoss))
				  (GO QUIT]
          [COND
	    ((AND (NOT (GetValue cargo (QUOTE status)))
		  (ISA (GetValue (GetValue self (QUOTE truck))
				 (QUOTE location))
		       ($ CityDump)))
	      (SETQ ↑value (PROGN [SETQ sellQty (MIN (GetValue (GetValue (GetValue self (QUOTE truck))
									 (QUOTE location))
							       (QUOTE qty))
						     (GetValue cargo (QUOTE qty]
				  (← PlayerInterface Sell self cargo sellQty)
				  (PROGN                     (* ↑value set by RuleSetStop)
					 (RuleSetStop T (QUOTE Sold)
						      (QUOTE AtCityDump))
					 (GO QUIT]
          [COND
	    ((AND (GetValue cargo (QUOTE status))
		  [SETQ sellQty (MIN (GetValue (GetValue (GetValue self (QUOTE truck))
							 (QUOTE location))
					       (QUOTE qty))
				     (GetValue cargo (QUOTE qty]
		  (GEQ sellQty 1))
	      (SETQ ↑value (← PlayerInterface Sell self cargo sellQty]
      QUIT(RETURN ↑value])

(TakeTurnBigMacRules
  [LAMBDA (self)
    (PROG (↑auditRecord ↑value temp)
          [COND
	    ((NOT (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 "LNS.0.5349.46.57775.40")))
				  (PutAuditRec self (QUOTE destination)
					       (AnyRoadStop ($ AlicesRestaurant))
					       ↑auditRecord)
				  (PutAuditRec self (QUOTE direction)
					       (QUOTE Forward)
					       ↑auditRecord]
          [COND
	    ((NOT (GetValue self (QUOTE nextDestination)))
	      (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 "LNS.0.5349.46.57775.41")))
				  (PutAuditRec self (QUOTE nextDestination)
					       (AnyRoadStop ($ UnionHall))
					       ↑auditRecord)
				  (SETQ temp (QUOTE Backward]
          [COND
	    ((EQ (GetValue self (QUOTE stoppingPlace))
		 (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 "LNS.0.5349.46.57775.42")))
				  (PutAuditRec self (QUOTE destination)
					       (GetValue self (QUOTE nextDestination))
					       ↑auditRecord)
				  (PutAuditRec self (QUOTE direction)
					       temp ↑auditRecord]
          [COND
	    ((← (GetValue (GetValue self (QUOTE truck))
			  (QUOTE location))
		InstOf
		($ UnionHall))
	      (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 "LNS.0.5349.46.57775.43")))
				  (PutAuditRec self (QUOTE nextDestination)
					       (AnyRoadStop ($ AlicesRestaurant))
					       ↑auditRecord)
				  (SETQ temp (QUOTE Forward]
          [COND
	    ((← (GetValue (GetValue self (QUOTE truck))
			  (QUOTE location))
		InstOf
		($ 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 "LNS.0.5349.46.57775.44")))
				  (PutAuditRec self (QUOTE nextDestination)
					       (AnyRoadStop ($ UnionHall))
					       ↑auditRecord)
				  (SETQ temp (QUOTE Backward]
          (SETQ ↑value (← self GoToStoppingPlace))
      QUIT(RETURN ↑value])

(TakeTurnTeamsterRules
  [LAMBDA (self)
    (PROG (↑auditRecord ↑value possibleStops)
          [COND
	    ((NOT (GetValue self (QUOTE goal)))
	      (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 "LNS.0.5349.46.57775.49")))
				  (PutAuditRec self (QUOTE goal)
					       (QUOTE Peddle)
					       ↑auditRecord]
          [COND
	    ([AND (GetValue (GetValue self (QUOTE truck))
			    (QUOTE cargo))
		  (EQ (GetValue self (QUOTE goal))
		      (QUOTE Peddle))
		  (SETQ possibleStops (RoadStops ($ Consumer]
	      (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 "LNS.0.5349.46.57775.50")))
				  (PutAuditRec self (QUOTE destination)
					       (PickHiObj self (QUOTE RateConsumers)
							  possibleStops)
					       ↑auditRecord]
          [COND
	    ([AND (NOT (GetValue (GetValue self (QUOTE truck))
				 (QUOTE cargo)))
		  (EQ (GetValue self (QUOTE goal))
		      (QUOTE Peddle))
		  (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 "LNS.0.5349.46.57775.51")))
				  (PutAuditRec self (QUOTE destination)
					       (PickHiObj self (QUOTE RateProducers)
							  possibleStops)
					       ↑auditRecord]
          [COND
	    ([AND (EQ (GetValue self (QUOTE goal))
		      (QUOTE GoToAlices))
		  (EQ (GetValue (GetValue self (QUOTE truck))
				(QUOTE location))
		      (GetValue self (QUOTE alices]
	      (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 "LNS.0.5349.46.57775.52")))
				  (PutAuditRec self (QUOTE goal)
					       (QUOTE SitTight)
					       ↑auditRecord]
          [COND
	    ((AND (EQ (GetValue (GetValue self (QUOTE truck))
				(QUOTE location))
		      (GetValue self (QUOTE alices)))
		  (GREATERP (← self TimeAtStop)
			    25)
		  (EQ (GetValue self (QUOTE goal))
		      (QUOTE SitTight)))
	      (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 "LNS.0.5349.46.57775.53")))
				  (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))
			 50)
		  (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 "LNS.0.5349.46.57775.54")))
				  (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))
			 30)
		  (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 "LNS.0.5349.46.57775.55")))
				  (PutAuditRec self (QUOTE destination)
					       (NearestRoadStop (RoadStops ($ AlicesRestaurant)))
					       ↑auditRecord)
				  (PutAuditRec self (QUOTE goal)
					       (QUOTE GoToAlices)
					       ↑auditRecord]
          [COND
	    ([NOT (OR (EQ (GetValue self (QUOTE goal))
			  (QUOTE SitTight))
		      (AND (EQ (GetValue self (QUOTE goal))
			       (QUOTE GetClose))
			   (LEQ (Distance (GetValue (GetValue self (QUOTE truck))
						    (QUOTE location))
					  (GetValue self (QUOTE alices)))
				3]
	      (SETQ ↑value (← self GoToStoppingPlace]
      QUIT(RETURN ↑value])

(Teamster.SelectPr
  [LAMBDA (self roadStop)                                    (* edited: "15-JUL-83 10:39")
                                                             (* Select a price ratio and return it)
    (GetValue roadStop (QUOTE pr])
)
(DECLARE: DONTCOPY
  (FILEMAP (NIL (54954 76610 (FindStoppingPlaceTeamsterRules 54964 . 58216) (GetPriceRatio 58218 . 58389
) (GoToStoppingPlaceTeamsterRules 58391 . 60312) (MaxPurchaseTeamsterRules 60314 . 61696) (
RateConsumersTeamsterRules 61698 . 63226) (RateProducersTeamsterRules 63228 . 64958) (
RateSpotsNearAlicesTeamsterRules 64960 . 65893) (SellGoodsTeamsterRules 65895 . 67992) (
TakeTurnBigMacRules 67994 . 71029) (TakeTurnTeamsterRules 71031 . 76350) (Teamster.SelectPr 76352 . 
76608)))))
STOP