コード例 #1
0
    def __init__(self,
                 name,
                 passwd="secret",
                 manager_jid="cmanager@localhost",
                 x=0,
                 z=0,
                 team=0):

        CJGomasAgent.__init__(self, name, passwd, team)
        self.m_eType = self.PACK_NONE
        self.m_Manager = manager_jid

        self.m_Position = Vector3D()
        self.m_Position.x = (x * 8)
        self.m_Position.y = 0
        self.m_Position.z = (z * 8)

        self.m_eTeam = team
コード例 #2
0
ファイル: CManager.py プロジェクト: gti-ia/pgomas
    def __init__(self,
                 name="cmanager@localhost",
                 passwd="secret",
                 players=10,
                 fps=0.033,
                 match_time=380,
                 path=None,
                 mapname="map_01",
                 service_jid="cservice@localhost"):

        CJGomasAgent.__init__(self, name, passwd, service_jid=service_jid)
        self.MAX_TOTAL_AGENTS = players
        self.m_iFPS = fps
        self.m_lMatchTime = match_time
        self.m_sMapName = str(mapname)
        self.m_CConfig = CConfig()
        if path is not None:
            self.m_CConfig.setDataPath(path)
        self.m_iNumberOfAgents = 0
        self.m_AgentList = {}
        self.m_lMatchInit = 0
        self.m_domain = name.split('@')[1]
        self.ObjectiveAgent = None
        self.cservice = None
コード例 #3
0
ファイル: CTroop.py プロジェクト: gti-ia/pgomas
    def __init__(self,
                 jid,
                 passwd,
                 team=TEAM_NONE,
                 manager_jid="cmanager@localhost",
                 service_jid="cservice@localhost"):

        # Task List Lock
        self.m_TaskListLock = threading.Lock()

        self.m_ServiceType = []

        # Variable used to store the AID of Manager
        self.m_Manager = manager_jid
        self.m_Service = service_jid

        # List of prepared to execut tasks
        self.m_TaskList = {}

        # Variable used to point the current task in execution
        self.m_CurrentTask = None

        # Variable indicating if this agent is carrying the objective pack (flag)
        self.m_bObjectiveCarried = False

        # Array of default values of priorities for each task
        self.m_TaskPriority = {}

        # Array of points used in patrolling task
        self.m_ControlPoints = []

        # Current position in array m_ControlPoints
        self.m_iControlPointsIndex = 0

        # Array of points used in walking (a calculated) path task
        self.m_AStarPath = []

        # Current position in array m_AStarPath
        self.m_iAStarPathIndex = 0

        # List of objects in the agent's Field Of Vision
        self.m_FOVObjects = []

        # Current aimed enemy
        self.m_AimedAgent = None  # CSight

        self.m_eClass = 0
        self.m_iHealth = 0
        self.m_iProtection = 0
        self.m_iStamina = 0
        self.m_iPower = 0
        self.m_iAmmo = 0

        # Variable indicating if agent is fighting at this moment
        self.m_bFighting = False

        # Variable indicating if agent is escaping at this moment
        self.m_bEscaping = False

        # Current position, direction, and so on...
        self.m_Movement = None  # CMobile

        self.m_iSoldiersCount = 0
        self.m_iMedicsCount = 0
        self.m_iEngineersCount = 0
        self.m_iFieldOpsCount = 0
        self.m_iTeamCount = 0

        # Limits of some variables (to trigger some events)
        self.m_Threshold = CThreshold()  # CThreshold

        # Current Map
        self.m_Map = None  # CTerrainMap

        self.m_FSM = None  # FSMBehaviour

        CJGomasAgent.__init__(self, jid, passwd, team=team)