Class UnitySpaceStationComponent
java.lang.Object
edu.tufts.hrilab.diarc.DiarcComponent
edu.tufts.hrilab.unity.UnityAgentComponent
edu.tufts.hrilab.unity.space_station.UnitySpaceStationComponent
- All Implemented Interfaces:
UnitySpaceStationInterface
public class UnitySpaceStationComponent
extends UnityAgentComponent
implements UnitySpaceStationInterface
-
Field Summary
Fields inherited from class edu.tufts.hrilab.unity.UnityAgentComponent
agent, isConnectedFields inherited from class edu.tufts.hrilab.diarc.DiarcComponent
executionLoopCycleTime, log, shouldRunExecutionLoop -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloatGets the health of the space station as a float [0:100].booleanGets the broken state of a tube, true if broken.booleanGets the damaged state of a tube, true if damaged.floatGets the health of a specific tube via name as a float [0:100].booleangetSpaceStationTubeOff(Symbol tube) Gets the off state of a tube, true if off.Gets a list of broken tubes, optionally limited to the area.Gets a list of damaged tubes, optionally limited to the area.Gets a list of off tubes, optionally limited to a area.protected floatprotected floathealthResponse(Symbol tube) protected floathealthResponse(Message msg) Sends a health or tubeHealth message to Unity and awaits the response.tubesResponse(Message msg) Sends a tubesDamaged, tubesBroken or tubesOff message to Unity and awaits the response.tubesResponse(String action) tubesResponse(String action, Symbol area) protected booleantubeStateResponse(String action, Symbol tube) Sends a tubeDamaged, tubeBroken or tubeOff message requesting the state of a specific tube.Methods inherited from class edu.tufts.hrilab.unity.UnityAgentComponent
additionalUsageInfo, connected, getResponse, listen, listen, parseArgs, route, sendMessage, unityReceiveMessage, workloadMethods inherited from class edu.tufts.hrilab.diarc.DiarcComponent
attachShutdownHook, createInstance, createInstance, createInstance, executionLoop, getMyGroupConstraints, getMyGroups, getMyService, getMyServices, init, main, postRegistrationInit, shutdown, shutdownComponent
-
Constructor Details
-
UnitySpaceStationComponent
public UnitySpaceStationComponent()
-
-
Method Details
-
healthResponse
Sends a health or tubeHealth message to Unity and awaits the response. Value is index 0 in response message response : ["100"] -
healthResponse
protected float healthResponse() -
healthResponse
-
tubesResponse
Sends a tubesDamaged, tubesBroken or tubesOff message to Unity and awaits the response. Response is list of strings containing all matching tubes -
tubesResponse
-
tubesResponse
-
tubeStateResponse
Sends a tubeDamaged, tubeBroken or tubeOff message requesting the state of a specific tube. Response is in form ["name", "true"] where index 0 is the name of the requested state and index 1 is the stringified boolean of the state. -
getSpaceStationHealth
public float getSpaceStationHealth()Gets the health of the space station as a float [0:100].- Specified by:
getSpaceStationHealthin interfaceUnitySpaceStationInterface
-
getSpaceStationTubesDamaged
Gets a list of damaged tubes, optionally limited to the area.- Specified by:
getSpaceStationTubesDamagedin interfaceUnitySpaceStationInterface
-
getSpaceStationTubesDamaged
- Specified by:
getSpaceStationTubesDamagedin interfaceUnitySpaceStationInterface
-
getSpaceStationTubesBroken
Gets a list of broken tubes, optionally limited to the area.- Specified by:
getSpaceStationTubesBrokenin interfaceUnitySpaceStationInterface
-
getSpaceStationTubesBroken
- Specified by:
getSpaceStationTubesBrokenin interfaceUnitySpaceStationInterface
-
getSpaceStationTubesOff
Gets a list of off tubes, optionally limited to a area.- Specified by:
getSpaceStationTubesOffin interfaceUnitySpaceStationInterface
-
getSpaceStationTubesOff
- Specified by:
getSpaceStationTubesOffin interfaceUnitySpaceStationInterface
-
getSpaceStationTubeHealth
Gets the health of a specific tube via name as a float [0:100].- Specified by:
getSpaceStationTubeHealthin interfaceUnitySpaceStationInterface
-
getSpaceStationTubeDamaged
Gets the damaged state of a tube, true if damaged.- Specified by:
getSpaceStationTubeDamagedin interfaceUnitySpaceStationInterface
-
getSpaceStationTubeBroken
Gets the broken state of a tube, true if broken.- Specified by:
getSpaceStationTubeBrokenin interfaceUnitySpaceStationInterface
-
getSpaceStationTubeOff
Gets the off state of a tube, true if off.- Specified by:
getSpaceStationTubeOffin interfaceUnitySpaceStationInterface
-