SpaceTime.DataModel
Interface SpaceTimeDataAdapter


public interface SpaceTimeDataAdapter

SpaceTimeDataAdapter provides a thin abstraction to query and allows to manipulate the space-time world state. Data loaded from XML is stored in a tree structure of SpaceTimeNodes according to Space Time objects hierarchy (like room hierarchy). Lookup and modification methods are provided


Method Summary
 void AddEventListener(EventListener listener)
          Binds a new EventListener to the adapter
 void AddGlobalChangeListener(ChangeListener listener)
          Binds a new ChangeListener to the adapter
 void ApplyDefaultRulesToAllEvents()
          Applies the default rules to all events for which the rules are allowed.
 void ApplyDefaultRulesToAllNodes()
          Applies the default rules to all nodes (both events and rooms) for which the rules are allowed.
 void ApplyDefaultRulesToAllRooms()
          Applies the default rules to all rooms for which the rules are allowed.
 void ApplyDefaultRulesToNode(SpaceTimeNode node)
          Applies the default rules the node if the rules are allowed for this node.
 SpaceTimeEdge CreateEdge(java.lang.String target, java.lang.String edgeType)
          Creates new edge object at the server side, edge is not associated with Object node
 SpaceTimeNode CreateNode(java.lang.String xml)
          Creates a node from an xml string and adds it to the data adapter.
 SpaceTimeProperty CreateProperty(java.lang.String propertyType)
          Creates new propery object on the server side
 void FlushScores()
          Clears the scores for all nodes
 java.lang.String GetAssociatedPropertyName(java.lang.String propertyName)
          Returns associated propery name
 java.lang.String GetAssociatedWeightName(java.lang.String propertyName)
          Returns associated weight name
 float GetGlobalScore()
          Global score
 DMArrayList GetLeafNodesById(java.lang.String id)
          Return only the most derrived nodes from the id specified.
 SpaceTimeNode GetNodeById(java.lang.String id)
          Get the node that matches id
 java.lang.String GetNodeXml(java.lang.String nodeId)
          Produces an xml fragment that represents the node reference provided.
 java.lang.String GetOptimizationHint()
          Current optimization hint string
 OrdersManager GetOrdersManager()
          Orders manager
 Parameters GetParameters()
          Returns the object with parameters from params.txt file
 DMArrayList GetPeople()
          Gets all people
 SpaceTimeProperty GetProperty(SpaceTimeNode node, java.lang.String propertyType)
          Gets the deepest property with the name propertyType defined in the tree.
 java.lang.String GetPropertyAssociationType(java.lang.String requestPref)
          Returns the association type of the provided property
 DMArrayList GetRequests()
          Gets all requests
 DMArrayList GetRooms()
          Gets all rooms
 long GetScenarioDuration()
          Scenario duration
 long GetScenarioStart()
          Scenario start in unix time format
 long GetScenarioStop()
          Scenario stop in unix time format
 VendorsManager GetVendorsManager()
          Vendors manager
 boolean IsOptRecommended()
          Optimization is recommended flag
 void IsOptRecommended(boolean value)
           
 boolean IsPropertyAssociated(java.lang.String propertyName)
          Checks if property is associated
 void LoadEventDefaultRules(java.lang.String filename)
          Loads the set of default rules for events from the specified file or URL.
 void LoadRoomDefaultRules(java.lang.String filename)
          Loads the set of default rules for rooms from the specified file or URL.
 void MergeAssignments(DMArrayList assignments)
          Merge a list of assignments with the current worldstate.
 void MergeOptimizationResults(DMArrayList assignments, double score)
          Merge optimizer output with the current worldstate.
 void NotifyElicitationDone(java.lang.String url)
          Generates "notification done" event and notifies event listeners
 void NotifyEndOfBatchLearning()
          Generates "end of batch learning" event and notifies event listeners
 void NotifyEndOfWargames()
          Generates "end of wargames" event and notifies event listeners
 void NotifyNodeChange(SpaceTimeNode node)
          This should only be called by SpaceTimeNode
 void NotifyOptimizationDone()
          Generates "optimization done" event and notifies event listeners
 void NotifySchedulePublished(java.lang.String url)
          Generates "shedule published" event and notifies event listeners
 void NotifyVendorElicitorDone(java.lang.String url)
          Generates "vendor elicitor done" event and notifies event listeners
 void NotifyVendorOptimizerDone(java.lang.String url)
          Generates "vendor optimizer done" event and notifies event listeners
 void RemoveEventListener(EventListener listener)
          Unbinds EventListener from the adapter
 void RemoveGlobalChangeListener(ChangeListener listener)
          Unbinds ChangeListener from the adapter
 void Save(java.lang.String filename)
          Save object model to xml
 java.lang.String SaveAsString(boolean fixAssigned, boolean fixUnassigned)
          Produces XML string for current worldstate
 void SaveInheritedStpToFile(java.lang.String filename, boolean fixAssigned, boolean fixUnassigned)
          Save object model to xml propagating inherited properties, optionally fixing allocations
 void SaveToFile(java.lang.String filename, boolean fixAssigned, boolean fixUnassigned)
          Save object model to xml, optionally fixing allocations
 void Unbind()
          Fully flush all node events and bindings
 void UpdateScore()
          Envokes the optimizer to get event scores
 boolean VendorOrdersInitialized()
          Vendor orders initilization check
 

Method Detail

GetParameters

Parameters GetParameters()
Returns the object with parameters from params.txt file


VendorOrdersInitialized

boolean VendorOrdersInitialized()
Vendor orders initilization check

Returns:

GetVendorsManager

VendorsManager GetVendorsManager()
Vendors manager


GetOrdersManager

OrdersManager GetOrdersManager()
Orders manager


CreateEdge

SpaceTimeEdge CreateEdge(java.lang.String target,
                         java.lang.String edgeType)
Creates new edge object at the server side, edge is not associated with Object node


CreateProperty

SpaceTimeProperty CreateProperty(java.lang.String propertyType)
Creates new propery object on the server side


AddGlobalChangeListener

void AddGlobalChangeListener(ChangeListener listener)
Binds a new ChangeListener to the adapter


RemoveGlobalChangeListener

void RemoveGlobalChangeListener(ChangeListener listener)
Unbinds ChangeListener from the adapter


AddEventListener

void AddEventListener(EventListener listener)
Binds a new EventListener to the adapter


RemoveEventListener

void RemoveEventListener(EventListener listener)
Unbinds EventListener from the adapter


Unbind

void Unbind()
Fully flush all node events and bindings


NotifyNodeChange

void NotifyNodeChange(SpaceTimeNode node)
This should only be called by SpaceTimeNode


NotifyElicitationDone

void NotifyElicitationDone(java.lang.String url)
Generates "notification done" event and notifies event listeners


NotifyVendorOptimizerDone

void NotifyVendorOptimizerDone(java.lang.String url)
Generates "vendor optimizer done" event and notifies event listeners


NotifyVendorElicitorDone

void NotifyVendorElicitorDone(java.lang.String url)
Generates "vendor elicitor done" event and notifies event listeners


NotifySchedulePublished

void NotifySchedulePublished(java.lang.String url)
Generates "shedule published" event and notifies event listeners


NotifyOptimizationDone

void NotifyOptimizationDone()
Generates "optimization done" event and notifies event listeners


NotifyEndOfWargames

void NotifyEndOfWargames()
Generates "end of wargames" event and notifies event listeners


NotifyEndOfBatchLearning

void NotifyEndOfBatchLearning()
Generates "end of batch learning" event and notifies event listeners


GetScenarioStart

long GetScenarioStart()
Scenario start in unix time format


GetScenarioDuration

long GetScenarioDuration()
Scenario duration


GetScenarioStop

long GetScenarioStop()
Scenario stop in unix time format


GetGlobalScore

float GetGlobalScore()
Global score


UpdateScore

void UpdateScore()
Envokes the optimizer to get event scores


GetRooms

DMArrayList GetRooms()
Gets all rooms


GetPeople

DMArrayList GetPeople()
Gets all people


GetRequests

DMArrayList GetRequests()
Gets all requests


GetLeafNodesById

DMArrayList GetLeafNodesById(java.lang.String id)
Return only the most derrived nodes from the id specified. The return value is a list of SpaceTimeDataObjectNodes


GetNodeById

SpaceTimeNode GetNodeById(java.lang.String id)
Get the node that matches id


GetProperty

SpaceTimeProperty GetProperty(SpaceTimeNode node,
                              java.lang.String propertyType)
Gets the deepest property with the name propertyType defined in the tree.


GetPropertyAssociationType

java.lang.String GetPropertyAssociationType(java.lang.String requestPref)
Returns the association type of the provided property


GetAssociatedWeightName

java.lang.String GetAssociatedWeightName(java.lang.String propertyName)
Returns associated weight name


GetAssociatedPropertyName

java.lang.String GetAssociatedPropertyName(java.lang.String propertyName)
Returns associated propery name


IsPropertyAssociated

boolean IsPropertyAssociated(java.lang.String propertyName)
Checks if property is associated


FlushScores

void FlushScores()
Clears the scores for all nodes


LoadRoomDefaultRules

void LoadRoomDefaultRules(java.lang.String filename)
Loads the set of default rules for rooms from the specified file or URL. New set replaces the old one


LoadEventDefaultRules

void LoadEventDefaultRules(java.lang.String filename)
Loads the set of default rules for events from the specified file or URL. New set replaces the old one


ApplyDefaultRulesToAllNodes

void ApplyDefaultRulesToAllNodes()
Applies the default rules to all nodes (both events and rooms) for which the rules are allowed.


ApplyDefaultRulesToAllRooms

void ApplyDefaultRulesToAllRooms()
Applies the default rules to all rooms for which the rules are allowed.


ApplyDefaultRulesToAllEvents

void ApplyDefaultRulesToAllEvents()
Applies the default rules to all events for which the rules are allowed.


ApplyDefaultRulesToNode

void ApplyDefaultRulesToNode(SpaceTimeNode node)
Applies the default rules the node if the rules are allowed for this node.


GetOptimizationHint

java.lang.String GetOptimizationHint()
Current optimization hint string


MergeOptimizationResults

void MergeOptimizationResults(DMArrayList assignments,
                              double score)
Merge optimizer output with the current worldstate. "end of optimization" event is generated


MergeAssignments

void MergeAssignments(DMArrayList assignments)
Merge a list of assignments with the current worldstate.


CreateNode

SpaceTimeNode CreateNode(java.lang.String xml)
Creates a node from an xml string and adds it to the data adapter. The node is added to the tree hierarchy according to its EDGE properites. If no inheritance is defined the node is added to the root tree node.


Save

void Save(java.lang.String filename)
Save object model to xml


SaveToFile

void SaveToFile(java.lang.String filename,
                boolean fixAssigned,
                boolean fixUnassigned)
Save object model to xml, optionally fixing allocations


SaveInheritedStpToFile

void SaveInheritedStpToFile(java.lang.String filename,
                            boolean fixAssigned,
                            boolean fixUnassigned)
Save object model to xml propagating inherited properties, optionally fixing allocations


SaveAsString

java.lang.String SaveAsString(boolean fixAssigned,
                              boolean fixUnassigned)
Produces XML string for current worldstate


GetNodeXml

java.lang.String GetNodeXml(java.lang.String nodeId)
Produces an xml fragment that represents the node reference provided.


IsOptRecommended

boolean IsOptRecommended()
Optimization is recommended flag


IsOptRecommended

void IsOptRecommended(boolean value)