cad.simcad.main_server
Class CADAmbulanceChooser

java.lang.Object
  |
  +--cad.simcad.main_server.CADAmbulanceChooser
All Implemented Interfaces:
VehiculeChooser

public class CADAmbulanceChooser
extends java.lang.Object
implements VehiculeChooser

Author:
cbentley To change this generated comment edit the template variable "typecomment": Window>Preferences>Java>Templates. To enable and disable the creation of type comments go to Window>Preferences>Java>Code Generation.

Field Summary
protected  APSS _apss
           
protected  IDPathUser[] _cache
          This is the cache used to removed last found vehicules from new searches By default, we are not looking for the last 3 vehicules
protected  CacMediatorI _cacm
           
 
Constructor Summary
CADAmbulanceChooser(CacMediatorI cacm)
           
 
Method Summary
 void addToCache(IDPathUser pu)
          Add the given PathUser to the cache structure
 java.util.Map cleanse(java.util.Map m)
          Remove PathUser objects values and associated their keys that are in the cache
 void flushCache()
          Flush the cache of all entries
 java.util.Map getAcceptableVehicles()
           
 EmergencyVehicule getBestVehicule(Incident i)
          Returns the best vehicule for the given Incident
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_cacm

protected CacMediatorI _cacm

_apss

protected APSS _apss

_cache

protected IDPathUser[] _cache
This is the cache used to removed last found vehicules from new searches By default, we are not looking for the last 3 vehicules

Constructor Detail

CADAmbulanceChooser

public CADAmbulanceChooser(CacMediatorI cacm)
Method Detail

getBestVehicule

public EmergencyVehicule getBestVehicule(Incident i)
Returns the best vehicule for the given Incident

Specified by:
getBestVehicule in interface VehiculeChooser
Parameters:
i - Incident
Pre:
An incident
Returns:
An EmergencyVehicule
Post:
The EmergencyVehicule that is the fittest for solving the Incident is returned

addToCache

public void addToCache(IDPathUser pu)
Add the given PathUser to the cache structure


flushCache

public void flushCache()
Flush the cache of all entries


cleanse

public java.util.Map cleanse(java.util.Map m)
Remove PathUser objects values and associated their keys that are in the cache

Pre:
a Map object mapping PathPlace objects to PathUser objects
Post:
the same Map is returned, but up to the 3 last PathUsers that are in the cache are removed from the Map

getAcceptableVehicles

public java.util.Map getAcceptableVehicles()

Logo

With the help of www.sourceforge.net and www.info.ucl.ac.be