mil.af.afit.router
Class Site

java.lang.Object
  |
  +--java.util.Observable
        |
        +--mil.af.afit.router.Site
All Implemented Interfaces:
java.io.Serializable

public class Site
extends java.util.Observable
implements java.io.Serializable

A site is a location to visit. It may have a time window or time wall associated with it. It may have a specific requirement for what kind of vehicle needs to service it.

Since:
1.0
See Also:
SiteList, Serialized Form

Constructor Summary
Site()
          Constructs a site with default values.
Site(Site copyThis)
          Constructs a site identical to copyThis.
Site(java.lang.String name, double latitude, double longitude)
          Constructs a site with specified name, latitude, and longitude.
Site(java.lang.String name, double latitude, double longitude, int priority)
          Constructs a site with specified name, latitude, longitude, and priority.
 
Method Summary
 int getEarliestArrivalTime()
          Returns the beginning of time window for the site.
 int getEarliestRestrictedTime()
          Returns the beginning of time wall for the site.
 int getID()
          Returns the id of the site.
 int getLatestDepartureTime()
          Returns the ending of time window for the site.
 int getLatestRestrictedTime()
          Returns the ending of time wall for the site.
 double getLatitude()
          Returns the latitude of the site.
 double getLongitude()
          Returns the longitude of the site.
 java.lang.String getName()
          Returns the name of the site.
 int getPriority()
          Returns the priority of the site.
 java.lang.String getRequirementType()
          Returns the requirement type of the site.
 int getServiceTime()
          Returns the service time (in minutes) for the site.
 boolean isEnabled()
          Returns whether or not the site is enabled.
 int isEnabledAsNumber()
          Returns whether or not the site is enabled, 1 for true, 2 for false.
static void setDefaultPriority(int priority)
          Set default priority for sites (a static variable).
static void setDefaultServiceTime(int time)
          Set default service time for sites (a static variable).
 void setEarliestArrivalTime(int time)
          Sets the beginning of the time window for the site.
 void setEarliestRestrictedTime(int time)
          Sets the beginning of the time wall for the site.
 void setEnabled(boolean state)
          Sets whether or not the site is enabled.
 void setLatestDepartureTime(int time)
          Sets the ending of the time window for the site.
 void setLatestRestrictedTime(int time)
          Sets the ending of the time wall for the site.
 void setLatitude(double latitude)
          Sets the latitude for the site.
 void setLongitude(double longitude)
          Sets the longitude for the site.
 void setName(java.lang.String name)
          Sets the name for the site.
 void setPriority(int priority)
          Sets the priority for the site.
 void setRequirementType(java.lang.String type)
          Sets the requirement type for the site.
 void setServiceTime(int minutes)
          Sets the service time (in minutes) for the site.
 java.lang.String toString()
           
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Site

public Site()
Constructs a site with default values.
Since:
1.0

Site

public Site(java.lang.String name,
            double latitude,
            double longitude)
Constructs a site with specified name, latitude, and longitude.
Parameters:
name - site name
latitude - site's latitude
longitude - site's longitude
Since:
1.0

Site

public Site(java.lang.String name,
            double latitude,
            double longitude,
            int priority)
Constructs a site with specified name, latitude, longitude, and priority.
Parameters:
name - site name
latitude - site's latitude
longitude - site's longitude
priority - site's priority
Since:
1.0

Site

public Site(Site copyThis)
Constructs a site identical to copyThis.
Parameters:
copyThis - site to copy
Since:
1.0
Method Detail

setDefaultServiceTime

public static final void setDefaultServiceTime(int time)
Set default service time for sites (a static variable).
Parameters:
time - default service time (in minutes) for new sites
Since:
1.0

setDefaultPriority

public static final void setDefaultPriority(int priority)
Set default priority for sites (a static variable).
Parameters:
priority - default priority for new sites
Since:
1.0

setName

public void setName(java.lang.String name)
Sets the name for the site.
Parameters:
name - name of the site
Since:
1.0

setEnabled

public void setEnabled(boolean state)
Sets whether or not the site is enabled. A disabled site will not be visited the next time a solution is found.
Parameters:
state - whether or not the site is enabled
Since:
1.0

setLatitude

public void setLatitude(double latitude)
Sets the latitude for the site.
Parameters:
latitude - the latitude for the site
Since:
1.0

setLongitude

public void setLongitude(double longitude)
Sets the longitude for the site.
Parameters:
longitude - the longitude for the site
Since:
1.0

setEarliestArrivalTime

public final void setEarliestArrivalTime(int time)
Sets the beginning of the time window for the site.
Parameters:
time - the beginning of the time window for the site
Since:
1.0

setLatestDepartureTime

public final void setLatestDepartureTime(int time)
Sets the ending of the time window for the site.
Parameters:
time - the ending of the time window for the site
Since:
1.0

setEarliestRestrictedTime

public final void setEarliestRestrictedTime(int time)
Sets the beginning of the time wall for the site.
Parameters:
time - the beginning of the wall window for the site
Since:
1.0

setLatestRestrictedTime

public final void setLatestRestrictedTime(int time)
Sets the ending of the time wall for the site.
Parameters:
time - the ending of the wall window for the site
Since:
1.0

setPriority

public final void setPriority(int priority)
Sets the priority for the site.
Parameters:
priority - the priority for the site
Since:
1.0

setRequirementType

public final void setRequirementType(java.lang.String type)
Sets the requirement type for the site.
Parameters:
type - the requirement type for the site
Since:
1.0

setServiceTime

public final void setServiceTime(int minutes)
Sets the service time (in minutes) for the site.
Parameters:
minutes - the service time (in minutes) for the site
Since:
1.0

getServiceTime

public final int getServiceTime()
Returns the service time (in minutes) for the site.
Returns:
the service time (in minutes) for the site
Since:
1.0

isEnabled

public final boolean isEnabled()
Returns whether or not the site is enabled.
Returns:
whether or not the site is enabled
Since:
1.0

isEnabledAsNumber

public final int isEnabledAsNumber()
Returns whether or not the site is enabled, 1 for true, 2 for false. This is used in a sorting algorithm elsewhere.
Returns:
whether or not the site is enabled
Since:
1.0

getID

public final int getID()
Returns the id of the site.
Returns:
id of the site
Since:
1.0

getName

public java.lang.String getName()
Returns the name of the site.
Returns:
name of the site
Since:
1.0

getLatitude

public double getLatitude()
Returns the latitude of the site.
Returns:
latitude of the site
Since:
1.0

getLongitude

public double getLongitude()
Returns the longitude of the site.
Returns:
longitude of the site
Since:
1.0

getEarliestArrivalTime

public final int getEarliestArrivalTime()
Returns the beginning of time window for the site.
Returns:
the beginning of time window for the site
Since:
1.0

getLatestDepartureTime

public final int getLatestDepartureTime()
Returns the ending of time window for the site.
Returns:
the ending of time window for the site
Since:
1.0

getEarliestRestrictedTime

public final int getEarliestRestrictedTime()
Returns the beginning of time wall for the site.
Returns:
the beginning of time wall for the site
Since:
1.0

getLatestRestrictedTime

public final int getLatestRestrictedTime()
Returns the ending of time wall for the site.
Returns:
the ending of time wall for the site
Since:
1.0

getPriority

public final int getPriority()
Returns the priority of the site.
Returns:
the priority of the site
Since:
1.0

getRequirementType

public final java.lang.String getRequirementType()
Returns the requirement type of the site.
Returns:
the requirement type of the site
Since:
1.0

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object