/usr/share/pyshared/fusil/project_agent.py is in fusil 1.4-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | from fusil.mas.agent import Agent
from weakref import ref as weakref_ref
from fusil.score import scoreLogFunc
class ProjectAgent(Agent):
def __init__(self, project, name, mta=None, application=None):
if not mta:
mta = project.mta()
Agent.__init__(self, name, mta)
self.project = weakref_ref(project)
if not application:
application = project.application()
self.application = weakref_ref(application)
if project is not self:
self.score_weight = 1.0
self.register()
def session(self):
project = self.project()
if not project:
return None
return project.session
def register(self):
self.project().registerAgent(self)
def unregister(self, destroy=True):
project = self.project()
if not project:
return
project.unregisterAgent(self, destroy)
def scoreLogFunc(self):
score = self.getScore()
return scoreLogFunc(self, score)
def getScore(self):
# Score: floating number, -1.0 <= score <= 1.0
# 1: bug found
# 0: nothing special
# -1: inputs rejected
return None
|