/** Scheduler. Determine what action is called for, and do it. */
 public boolean pickAndExecuteAnAction() {
   if (state == State.rcvdPayment) {
     for (int i = 0; i < marketBills.size(); i++) {
       Bill b = marketBills.get(i);
       if (b.cust == customer) {
         ProcessPayment(b, amt);
         UpdateInventory(b);
         return true;
       }
     }
   }
   //		print("no customers left: "+market.noCustomers());
   //		print("shiftdone? "+shiftDone);
   if (shiftDone) {
     if (market.noCustomers()) {
       ShiftDone();
       shiftDone = false;
     }
     return true;
   }
   if (state == State.left) {
     StopWork();
     return true;
   }
   return false;
 }
 public void StopWork() {
   state = State.idle;
   person.msgStopWork(wage);
   market.removeMe(this);
 }
Exemple #3
0
 public Bank getBank(Market market) {
   return bankByMarketMap.get(market.getOrganizationId());
 }