Package edu.tufts.hrilab.supermarket
Class SupermarketComponent
java.lang.Object
edu.tufts.hrilab.diarc.DiarcComponent
edu.tufts.hrilab.supermarket.SupermarketComponent
- All Implemented Interfaces:
PlanningAgent
,SupermarketInterface
public class SupermarketComponent
extends DiarcComponent
implements SupermarketInterface, PlanningAgent
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
protected edu.tufts.hrilab.supermarket.GamePlay
protected static boolean
protected int
protected SupermarketInterface
protected int
protected StateMachine
protected int
protected boolean
protected boolean
Fields inherited from class edu.tufts.hrilab.diarc.DiarcComponent
executionLoopCycleTime, log, shouldRunExecutionLoop
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<org.apache.commons.cli.Option>
Command line options available in sub-class.protected String
aisleObserver
(Term state) protected List<SupermarketObservation.InteractiveObject>
final Justification
protected String
cartName
(int cartIndex) void
void
foodName
(SupermarketObservation.Counter counter) protected SupermarketObservation.InteractiveObject
int
final Justification
goEast()
final Justification
goNorth()
final Justification
goSouth()
final Justification
goWest()
protected void
init()
Perform any component initialization.final Justification
boolean
isBusy()
lastCart()
navigationObserver
(Term state) final Justification
nop()
objectObserver
(Term state) protected void
parseArgs
(org.apache.commons.cli.CommandLine cmdLine) Called directly after construction to pass runtime values that will override default values.void
setBusy
(boolean busy) void
setObservation
(Object observation) void
void
void
protected int
final Justification
protected void
void
protected void
Methods inherited from class edu.tufts.hrilab.diarc.DiarcComponent
createInstance, createInstance, createInstance, createInstance, executionLoop, getMyGroupConstraints, getMyGroups, getMyService, getMyServices, main, shutdown, shutdownComponent
-
Field Details
-
loadedInitialBeliefs
protected static boolean loadedInitialBeliefs -
game
protected edu.tufts.hrilab.supermarket.GamePlay game -
agentName
-
playerIndex
protected int playerIndex -
useBelief
protected boolean useBelief -
socketPort
protected int socketPort -
simSocketPort
protected int simSocketPort -
simComponent
-
sm
-
useSim
protected boolean useSim
-
-
Constructor Details
-
SupermarketComponent
public SupermarketComponent() -
SupermarketComponent
-
-
Method Details
-
init
protected void init()Description copied from class:DiarcComponent
Perform any component initialization. This should not be used for setting local fields to default values as was the case in DIARC. This method is called after the constructor, and after parseArgs. Setting default values should be done in field declaration or in the constructor.- Overrides:
init
in classDiarcComponent
-
additionalUsageInfo
Description copied from class:DiarcComponent
Command line options available in sub-class. This should be paired with a parseArgs implementation.- Overrides:
additionalUsageInfo
in classDiarcComponent
- Returns:
-
parseArgs
protected void parseArgs(org.apache.commons.cli.CommandLine cmdLine) Description copied from class:DiarcComponent
Called directly after construction to pass runtime values that will override default values. This should parse all the options that additionalUsageInfo provides.zs- Overrides:
parseArgs
in classDiarcComponent
-
nop
- Specified by:
nop
in interfaceSupermarketInterface
-
goNorth
- Specified by:
goNorth
in interfaceSupermarketInterface
-
goSouth
- Specified by:
goSouth
in interfaceSupermarketInterface
-
goEast
- Specified by:
goEast
in interfaceSupermarketInterface
-
goWest
- Specified by:
goWest
in interfaceSupermarketInterface
-
cancelInteraction
- Specified by:
cancelInteraction
in interfaceSupermarketInterface
-
toggleShoppingCart
- Specified by:
toggleShoppingCart
in interfaceSupermarketInterface
-
interactWithObject
- Specified by:
interactWithObject
in interfaceSupermarketInterface
-
startGame
- Specified by:
startGame
in interfaceSupermarketInterface
-
resetGame
- Specified by:
resetGame
in interfaceSupermarketInterface
-
getLastObservation
- Specified by:
getLastObservation
in interfaceSupermarketInterface
-
setObservation
- Specified by:
setObservation
in interfaceSupermarketInterface
-
aisleObserver
-
objectObserver
-
transmitPlayerInitialBeliefs
protected void transmitPlayerInitialBeliefs() -
transmitInitialBeliefs
protected void transmitInitialBeliefs() -
transmitNewCartBeliefs
public void transmitNewCartBeliefs()- Specified by:
transmitNewCartBeliefs
in interfaceSupermarketInterface
-
enableSim
public void enableSim() -
disableSim
public void disableSim() -
setSimObservation
public void setSimObservation() -
getSimStateMachine
-
setSimStateMachine
-
getSimPort
- Specified by:
getSimPort
in interfaceSupermarketInterface
-
getStateMachine
- Specified by:
getStateMachine
in interfaceSupermarketInterface
-
setStateMachine
- Specified by:
setStateMachine
in interfaceSupermarketInterface
-
cartName
-
foodName
-
foodName
-
lastCart
- Specified by:
lastCart
in interfaceSupermarketInterface
-
getAgentName
- Specified by:
getAgentName
in interfaceSupermarketInterface
-
getPlayerIndex
public int getPlayerIndex()- Specified by:
getPlayerIndex
in interfaceSupermarketInterface
-
aisleName
-
shelfIndex
-
allObjects
-
getInteractionTarget
-
isBusy
public boolean isBusy()- Specified by:
isBusy
in interfacePlanningAgent
-
setBusy
public void setBusy(boolean busy) - Specified by:
setBusy
in interfacePlanningAgent
-