| java.lang.Object org.cougaar.glm.util.GLMMeasure
GLMMeasure | public class GLMMeasure (Code) | | This class contains utility functions for measurements.
|
Method Summary | |
public Organization | bestOrg(GeolocLocation loc, Set orgs, String clusterName) given a geoloclocation and set of possible orgs, suggest
the best (closest) org.
Parameters: orgs - Set of possible orgs Parameters: clusterName - cluster ident. | public Date | dateShift(Date d, float factor, int direction) Utility function to shift dates around. | public Date | decodeDate(Date d) Utility functions to decode Date objects. | public Distance | distanceBetween(GeolocLocation start, GeolocLocation end) | public Distance | distanceBetween(GeolocLocation start, GeolocLocation end, double multiplier) | public boolean | isForeignLoc(GeolocLocation org_loc) | public GeolocLocation | makeGeoloc(GLMFactory fac, String code, String name, double longd, double latd) This is a helper function to generate geo loc codes.
It is used in TOPSGlobalGroundAllocatorPlugin.getOrgLocation()
to initialize the static locations
of the known organizations. |
bestOrg | public Organization bestOrg(GeolocLocation loc, Set orgs, String clusterName)(Code) | | given a geoloclocation and set of possible orgs, suggest
the best (closest) org.
Parameters: orgs - Set of possible orgs Parameters: clusterName - cluster ident. for logger.isDebugEnabled()ging purposes Organization object indicating best org |
dateShift | public Date dateShift(Date d, float factor, int direction)(Code) | | Utility function to shift dates around. This is helpful
if you need to make a Date object that is "x hours before/after
some reference date".
For example, READYAT dates could be 1 day before mission date.
Parameters: d - Date object representing the reference date Parameters: factor - float representing number of hours to shift Parameters: direction - int, should be either 1 or -1. 1 indicates shifting forward, -1 indicates shifting backward. Date the shifted date. |
decodeDate | public Date decodeDate(Date d)(Code) | | Utility functions to decode Date objects.
Given a Date object representing anytime of the day,
returns a Date object representing 12:00AM of that
same day.
Parameters: d - Date object representing the reference date Date, midnight of d. |
distanceBetween | public Distance distanceBetween(GeolocLocation start, GeolocLocation end)(Code) | | Utility function to calculate the distance between two locations
Parameters: start - GeolocLocation starting point Parameters: end - GeolocLocation ending point Distance between the two points |
distanceBetween | public Distance distanceBetween(GeolocLocation start, GeolocLocation end, double multiplier)(Code) | | Utility function to calculate the distance between two locations
Parameters: start - GeolocLocation starting point Parameters: end - GeolocLocation ending point Parameters: multiplier - Multiplier for the final dist result Distance between the two points |
isForeignLoc | public boolean isForeignLoc(GeolocLocation org_loc)(Code) | | test if location is US or foreign
What we really want to know is if the port is a POE or POD; is there a
better way? Should we just create a list of all ports and find the
closest each time we need one?
true if is a foreign port |
makeGeoloc | public GeolocLocation makeGeoloc(GLMFactory fac, String code, String name, double longd, double latd)(Code) | | This is a helper function to generate geo loc codes.
It is used in TOPSGlobalGroundAllocatorPlugin.getOrgLocation()
to initialize the static locations
of the known organizations. In the long term, it is hoped that
this can be phased out in favor of a native ALPINE mechanism.
Parameters: code - String representation of Geoloc code Parameters: name - String name of organization Parameters: longd - double degrees longitude Parameters: latd - double degrees latitude GeolocLocation initialized to input values |
|
|