def __init__(self, application): ProjectAgent.__init__(self, self, "project", mta=application.mta()) self.application = weakref_ref(application) self.agents = AgentList() if RUNNING_LINUX: if application.options.fast: self.system_calm = SystemCalm(0.75, 0.2) elif not application.options.slow: self.system_calm = SystemCalm(0.50, 0.5) else: self.system_calm = SystemCalm(0.30, 3.0) else: self.warning("SystemCalm class is not available") self.system_calm = None # Configuration self.max_session = application.options.session self.success_score = 0.50 # minimum score for a successful session self.error_score = -0.50 # maximum score for a session failure self.max_success = application.options.success # Session self.session = None self.session_index = 0 self.session_timeout = None # in second # Statistics self.session_executed = 0 self.session_total_duration = 0 self.total_duration = None # Add Application agents, order is important: MTA have to be the first agent for agent in application.agents: self.registerAgent(agent) self.registerAgent(self) # Create aggressivity agent self.aggressivity = AggressivityAgent(self) # Initial aggresssivity value if application.options.aggressivity is not None: self.aggressivity.setValue(application.options.aggressivity / 100) self.error("Initial aggressivity: %s" % self.aggressivity)