| java.lang.Object org.cougaar.planning.plugin.asset.AssetDataFileReader
AssetDataFileReader | public class AssetDataFileReader implements AssetDataReader(Code) | | Parses local asset prototype-ini.dat to create local asset and the
Report tasks associated with all the local asset's relationships.
Local asset must have ClusterPG and RelationshipPG, Presumption is
that the 'other' assets in all the relationships have both Cluster
and Relationship PGs. Currently assumes that each Agent has
exactly 1 local asset.
Format:
- parameter
# - comment character - rest of line ignored
Skeleton form:
[Prototype]
# asset class must have both a ClusterPG and a RelationshipPG
[Relationship]
# specifies Role played by this asset for another asset.
# If start/end be specified as "", they default to
# TimeSpan.MIN_VALUE/TimeSpan.MAX_VALUE
[]
# - one of Collection, List, String, Integer, Double, Boolean,
# Float, Long, Short, Byte, Character
Sample:
[Prototype]
Entity
[Relationship]
"Subordinate" "Headquarters" "Management" "HQ" "01/01/2001 12:00 am" "01/01/2010 11:59 pm"
"PaperProvider" "Beth's Day Care" "Day Care Ctr" "Beth's Home" "02/13/2001 9:00 am" ""
[ItemIdentificationPG]
ItemIdentification String "Staples, Inc"
Nomenclature String "Staples"
AlternateItemIdentification String "SPLS"
[TypeIdentificationPG]
TypeIdentification String "Office Goods Supplier"
Nomenclature String "Big Box"
AlternateTypeIdentification String "Stationer"
[ClusterPG]
MessageAddress MessageAddress "Staples"
[EntityPG]
Roles Collection "Subordinate, PaperProvider, CrayonProvider, PaintProvider"
|
fillRelationships | protected int fillRelationships(int newVal, StreamTokenizer tokens) throws IOException(Code) | | Fills in myRelationships with arrays of relationship, agentName and capableroles triples.
|
setLocationSchedulePG | protected int setLocationSchedulePG(String prop, int newVal, StreamTokenizer tokens) throws IOException(Code) | | Hack to attach a LocationSchedulePG to an Asset.
For now we only support a single LocationScheduleElementImpl
which has a LatLonPointImpl as it's Location. The TimeSpan
is hard-coded to TimeSpan.MIN_VALUE .. TimeSpan.MAX_VALUE.
In the future this can be enhanced to support full location
schedules, but that would likely require a new file format.
The format is:
"FixedLocation \"(" + LATITUDE + ", " + LONGITUDE + ")\""
For example, all of time at latitude 12.3 longitude -45.6:
FixedLocation "(12.3, -45.6)"
|
setPropertyForAsset | protected int setPropertyForAsset(String prop, int newVal, StreamTokenizer tokens) throws IOException(Code) | | Creates the property, fills in the slots based on what's in the
prototype-ini file and then sets it for (or adds it to) the asset
|
|
|