Package teamwork :: Package examples :: Package Thespian :: Module ThespianShell :: Class ThespianShell
[hide private]
[frames] | no frames]

Class ThespianShell

source code

shell.PsychShell.PsychShell --+
                              |
                             ThespianShell

Shell subclass enhanced for stories.

Instance Methods [hide private]
 
__init__(self, entities=None, classes=None, scene='3', debug=10) source code
 
createEntities(self) source code
 
executeCommand(self, cmd) source code
 
displayResult(self, cmd, result)
Terminal version of the output display method.
source code
 
printPath(self, result=[]) source code
 
printLocation(self, result=[]) source code
 
printLogFileName(self, result=[]) source code
 
runAppraisal(self, action, lookahead=1) source code
 
genObjectives(self, history) source code
 
getLastAct(self, history, changeEntity) source code
 
director2(self, result=[]) source code
 
director(self, result=[]) source code
 
make_story(self, entity, state, target, entities, history) source code
 
make_story_false(self, entity, state, target, entities, history, actor) source code
 
change_characters_state(self, character, choices, objectives) source code
 
formMessage(self, res) source code
 
step(self, length='100', results=[])
Steps the simulation the specified number of micro-steps into the future (default is 1)
source code
 
_step(self, length=100, results=[])
Steps the simulation the specified number of micro-steps into the future (default is 1)
source code
 
send(self, sender, receiver, *content) source code
 
__act__(self, actList, results) source code
 
doActions(self, actions, detailLevel=10, results=[], entities=None, isRealStep=1)
Performs the actions, provided in dictionary form
source code
 
loadClasses(self) source code
 
setScene(self, scene, results=[]) source code
 
reSetScene(self, results=[], entities=None, copyEntities=None) source code
 
reSetSceneWithGoals(self, goals={}, entities=None, copyEntities=None) source code
str
getCommand(self)
Terminal version of command entry.
source code
 
varyModel(self, actor, exclude=[], models=[], entities=None) source code
 
varyInitialState(self, actor, varyList={}, entities=None) source code
 
varyGoal(self, actor, fixedgoals=[], entities=None) source code
 
searchPath(self, path, act) source code
 
checkOrder(self, path, order) source code
 
checkComplete(self, path, complete) source code
 
FitToPlotPoint(self, storyPath, fixedgoals=[], delta=0, entities=None) source code
 
searchResult(self, res, exclude) source code
 
findSuggestion(self, path, obj, exclude=[{'feature': 'location','entity': 'red'}], entities=None) source code
 
findSuggestion2(self, path, obj, exclude, entities=None) source code
 
incrementalFitSequence(self, storyPath, fixedgoals=[], delta=0, entities=None) source code
 
fillGap(self, fixedgoals=[], maxstep=4, path=[], islands=[], actors=['wolf','red'], entities=None) source code
 
generateAllPosPath(self, actor, fixedgoals=[], maxstep=20, path=[], delta=-.000001, constraints=[], adjgoals=None, adjgoalKeys=None, P=None, start=[], entities=None) source code
 
easyFit(self, actor, storyPath) source code
 
fitSequence(self, storyPath, actor, fixedgoals=[], delta=0, entities=None) source code
 
adjustGoalWeights(self, constraints, entity, fixedgoals=[], delta=0) source code
 
satisfyConstraints(self, constraints, entity, fixedgoals=[], delta=0) source code

Inherited from shell.PsychShell.PsychShell: __search__, applyPolicy, distill, execute, export, getBelief, getEntities, getEntity, goals, handleMsg, handleSusceptibility, help, initEntities, iterateModels, load, loadSociety, mainloop, performAct, querySusceptibility, resetSociety, revert, save, saveSociety, search, setDebugLevel, setModel, setupEntities, setupScenario, setupSusceptibility, stop, test, undo

Class Variables [hide private]
  agentClass = ThespianAgent
the class of individual agents in the scenario (default is PsychEntity)
  multiagentClass = ThespianAgents
the class of the current scenario (default is SequentialAgents)
  entityList = {'3': [('granny', 'granny'), ('hunter', 'hunter')...

Inherited from shell.PsychShell.PsychShell: __KQML__, __UNDO__, __VERSION__, actionFormat

Method Details [hide private]

__init__(self, entities=None, classes=None, scene='3', debug=10)
(Constructor)

source code 
Parameters:
Overrides: shell.PsychShell.PsychShell.__init__
(inherited documentation)

executeCommand(self, cmd)

source code 
Overrides: shell.PsychShell.PsychShell.executeCommand

displayResult(self, cmd, result)

source code 

Terminal version of the output display method. Uses standard output.

Parameters:
  • cmd - the command executed
  • result - the results of the command
Overrides: shell.PsychShell.PsychShell.displayResult

step(self, length='100', results=[])

source code 

Steps the simulation the specified number of micro-steps into the future (default is 1)

Overrides: shell.PsychShell.PsychShell.step
(inherited documentation)

send(self, sender, receiver, *content)

source code 
Overrides: shell.PsychShell.PsychShell.send

__act__(self, actList, results)

source code 
Overrides: shell.PsychShell.PsychShell.__act__

doActions(self, actions, detailLevel=10, results=[], entities=None, isRealStep=1)

source code 

Performs the actions, provided in dictionary form

Parameters:
  • actions (dict:str→Action[]) - dictionary of actions to be performed, indexed by actor, e.g.:
    • agent1: [act11, act12, ... ]
    • agent2: [act21, act22, ... ]
    • ...
  • detailLevel (int) - the level of detail requested for the explanation, where higher numbers mean more detail. The default level is 10 (the maximum level of detail)
Overrides: shell.PsychShell.PsychShell.doActions

getCommand(self)

source code 

Terminal version of command entry. Prints a prompt (currently assumes turn-based execution) and reads the command entry from the input file.

Returns: str
Overrides: shell.PsychShell.PsychShell.getCommand

Class Variable Details [hide private]

entityList

Value:
{'3': [('granny', 'granny'), ('hunter', 'hunter'), ('wolf', 'wolf'), (\
'red', 'red'), ('woodcutter', 'woodcutter')], '31': [('red', 'red'), (\
'wolf', 'wolf')], '4': [('usr', 'usr'), ('cha', 'cha')], '6': [('usr',\
 'usr'), ('labrat', 'labrat1'), ('labrat', 'labrat2'), ('streetrat', '\
streetrat'), ('otherTeam', 'otherTeam'), ('timer', 'timer')], '7': [('\
usr', 'usr'), ('vc', 'vc')],}