|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--taxisrus.implementation.Scheduler
| Fields inherited from interface taxisrus.publicinterface.SchedulerInterface |
ASK_CABS_ONLY_ONCE, DEFAULT_AVERAGE_WAIT, DEFAULT_MIN_ETA |
| Constructor Summary | |
Scheduler(ModelInterface new_main_model,
int new_average_wait,
int new_min_ETA)
Create a Scheduler, with main_model & other user-defined parameters set as passed into constructor. |
|
Scheduler(ModelInterface new_main_model,
MapperInterface new_main_mapper)
Create an empty Scheduler, using default values for local parameters. |
|
| Method Summary | |
Date |
addCustomerToQueue(Customer to_pickup)
Add a new customer to queue of customers waiting to be picked up. |
void |
assignMapper(MapperInterface new_main_mapper)
Stores a reference to the main mapper. |
void |
assignModel(ModelInterface new_main_model)
Stores a reference to the main model. |
void |
assignNewAverageWait(int new_average_wait)
Store a new average_wait. |
void |
assignNewMinETA(int new_min_ETA)
Store a new min_ETA. |
void |
callOffCab(Cab to_cancel,
Customer customerToCancel)
Cancel a cab. |
boolean |
cancelCustomer(Customer to_cancel)
Cancel given Customer's ride request. |
Customer |
changeCustomerCopy(Customer curr_cust,
Customer new_cust)
Finds currCust within the scheduler, and replaces non-sorting or pickup critical fields within currCust to match newCust. |
void |
confirmCab(Cab to_cancel)
Confirm a cab reservation. |
boolean |
customerPickup(int cab_id)
Function to remove customers from the waiting_for_delivery queue when they reach their destination. |
void |
customerZonesSet(Customer zone_me)
Set pickup & destination zones for a customer. |
Customer |
findCustomer(Customer to_find)
Check if a customer is in a queue. |
int |
getAverageWait()
Get current value of average_wait |
ArrayList |
getCabsInZone(int zone_id)
Return a list of cabs for a given zone ID |
int |
getMinETA()
Get current value of min_ETA |
void |
manuallySchedule(Customer reschedule)
Notify dispatcher that automatic scheduling failed - must be manually scheduled. |
boolean |
openCommChannel(Cab to_talk_to,
Customer to_schedule)
Open up a communication channel with the given cab, and request that the cab pickup the given customer. |
boolean |
removeLimboCab(Cab to_remove)
Remove a cab from the limbo_cabs list, if on the list. |
void |
scheduleAllCustomers()
Schedule all customers who have been waiting long enough. |
void |
transferFromCommingToScheduled(Customer to_transfer)
Change a customer's status from COMING to SCHEDULED, and re-place in CustomerCollection all_customers. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Scheduler(ModelInterface new_main_model,
MapperInterface new_main_mapper)
throws BadParamException
ModelInterface - new_main_modelMapperInterface - new_main_mapperBadParamException -
public Scheduler(ModelInterface new_main_model,
int new_average_wait,
int new_min_ETA)
throws BadParamException
ModelInterface - new_main_modelDataStoreInterface - new_data_storeint - new_average_waitint - new_min_ETABadParamException - | Method Detail |
public void scheduleAllCustomers()
public void customerZonesSet(Customer zone_me)
Customer - zone_me
public boolean openCommChannel(Cab to_talk_to,
Customer to_schedule)
Cab - - Cab with which we are talking toCustomer - - Customer who is getting the ridepublic boolean removeLimboCab(Cab to_remove)
Cab - to_remove - Cab to remove from limbo_cabs listpublic void transferFromCommingToScheduled(Customer to_transfer)
Customer - to_transfer - Customer which will be moved.
public void callOffCab(Cab to_cancel,
Customer customerToCancel)
Cab - - Cab to cancelpublic void confirmCab(Cab to_cancel)
Cab - - Cab to reservationpublic ArrayList getCabsInZone(int zone_id)
int - - ID of a zonepublic void manuallySchedule(Customer reschedule)
Customer - - Customer who could not be scheduled.public int getAverageWait()
getAverageWait in interface SchedulerInterfacepublic int getMinETA()
getMinETA in interface SchedulerInterface
public void assignModel(ModelInterface new_main_model)
throws BadParamException
assignModel in interface SchedulerInterfaceModel - main_modelBadParamException -
public void assignMapper(MapperInterface new_main_mapper)
throws BadParamException
assignMapper in interface SchedulerInterfaceMapper - main_mapperBadParamException -
public void assignNewAverageWait(int new_average_wait)
throws BadParamException
assignNewAverageWait in interface SchedulerInterfaceint - new_average_waitBadParamException -
public void assignNewMinETA(int new_min_ETA)
throws BadParamException
assignNewMinETA in interface SchedulerInterfaceint - new_min_ETA, in minutes.BadParamException - public Date addCustomerToQueue(Customer to_pickup)
addCustomerToQueue in interface SchedulerInterfaceCustomer - to_queue - Customer to add to queuepublic Customer findCustomer(Customer to_find)
findCustomer in interface SchedulerInterfaceCustomer - - Customer to find.public boolean cancelCustomer(Customer to_cancel)
cancelCustomer in interface SchedulerInterfaceCustomer - - Customer to cancelpublic boolean customerPickup(int cab_id)
customerPickup in interface SchedulerInterfacecab_id - - id of the Cab that just picked up the customer
public Customer changeCustomerCopy(Customer curr_cust,
Customer new_cust)
changeCustomerCopy in interface SchedulerInterfaceCustomer - currCust - Old customer as stored in SchedulerCustomer - newCust - New customer to replace currCust in Scheduler
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||