Ejemplo n.º 1
0
def configure(sim):
	sim.settings = settings()
	sim.environment = environment()
	agent(sim.environment)
Ejemplo n.º 2
0
	def __init__(self):
		self.settings    = settings()
		self.environment = environment()
Ejemplo n.º 3
0
print ' === === === === === === SETTINGS === === === === === ==='
# load settings (same as in _example_basicUsage)
from behaviorSim.PECSagent.settings import settings
# customize settings
settings.deltaTime    = timedelta(days=1)
settings.simStartTime = datetime(2011, 1, 1, 12, 0, 0, 0)

print '* simulation start time (sim-time): ' + str(settings.simStartTime)
print '*     size of time step, deltaTime: ' + str(settings.deltaTime)

t0 = 0   #startTime
tf = 180 #endTime

# === === === === === === AGENT SETUP === === === === === ===
from behaviorSim.environment.environment import environment
envmt = environment()	# load default environment

# load agents personalities for i, ii, and iii
from behaviorSim.PECSagent.agent import agent
from behaviorSim.PECSagent.state.CSEL import agent_i, agent_ii, agent_iii
agent1 = agent(envmt)
agent1.state.setPersonality(agent_i.personality())

agent2 = agent(envmt)
agent2.state.setPersonality(agent_ii.personality())

agent3 = agent(envmt)
agent3.state.setPersonality(agent_iii.personality())
#add disturbances
from behaviorSim.PECSagent.state.CSEL.model_ddeint_firstOrder_withDisturbances import getEta
# print 'args='+str(agent3.state.eta_PA.args)
Ejemplo n.º 4
0
t = 5  #time of interest in simulation timesteps (set in settings)

#setup log file for this script
import logging
from behaviorSim.__util.setupLog import setupLog
setupLog()

# === === === === === === AGENT SETUP === === === === === ===
from behaviorSim.environment.environment import environment
envmt = environment()  #load default environment

from behaviorSim.PECSagent.agent import agent
myAgent = agent(envmt)  #load default agent
#TODO: customize the agent
#TODO: defaultAgent.tag = 'my very first agent'

# you can not reference the agent using 'myAgent' or 'envmt.agent[0]'

# add agent to environment

print ' === === === === === === SETTINGS === === === === === ==='
# load settings of the simulation (just FYI here)
from behaviorSim.PECSagent.settings import settings
print '* simulation start time (sim-time): ' + str(settings.simStartTime)
print '*     size of time step, deltaTime: ' + str(settings.deltaTime)

print ' === === === === === === DATA === === === === === ==='
print envmt.agents[0].inputs(0)
print envmt.agents[0].state(0)
print envmt.agents[0].motive(0)
print envmt.agents[0].behavior(0)
Ejemplo n.º 5
0
def getDefaultEnvironment():
    from behaviorSim.environment.environment import environment
    return environment()
    ''' returns a new agent with the default configuration '''
Ejemplo n.º 6
0
 def __init__(self):
     self.settings = settings()
     self.environment = environment()
Ejemplo n.º 7
0
def getDefaultEnvironment():
	from behaviorSim.environment.environment import environment
	return environment()
	
	''' returns a new agent with the default configuration '''