コード例 #1
0
 def __init__(self):
     """
     Init this agent
     :param size_x: battlefield horizontal size
     :param size_y: battlefield vertical size
     :param detector_num: detector quantity of this side
     :param fighter_num: fighter quantity of this side
     """
     BaseAgent.__init__(self)
     self.obs_ind = 'maddpg'
コード例 #2
0
 def __init__(self):
     """
     Init this agent
     :param size_x: battlefield horizontal size
     :param size_y: battlefield vertical size
     :param detector_num: detector quantity of this side
     :param fighter_num: fighter quantity of this side
     """
     BaseAgent.__init__(self)
     self.obs_ind = 'simple'
     if not os.path.exists('model/simple/model.pkl'):
         print('Error: agent simple model data not exist!')
         exit(1)
     self.fighter_model = dqn.RLFighter(ACTION_NUM)
コード例 #3
0
ファイル: agent.py プロジェクト: OldFuzzier/mymaca
 def __init__(self):
     """
     Init this agent
     :param size_x: battlefield horizontal size
     :param size_y: battlefield vertical size
     :param detector_num: detector quantity of this side
     :param fighter_num: fighter quantity of this side
     """
     BaseAgent.__init__(self)
     self.obs_ind = 'maddpg6'
     if not os.path.exists('model/{}/{}0.pkl'.format(MODEL_PATH, MODEL_NAME)):
         logger.info('Error: agent maddpg6 model data not exist!')
         exit(1)
     self.maddpg = MADDPG(FIGHTER_NUM, OBS_NUM, ACTION_NUM)
コード例 #4
0
ファイル: agent.py プロジェクト: JiaoAlvin/MaCA
 def __init__(self):
     """
     Init this agent
     :param size_x: battlefield horizontal size
     :param size_y: battlefield vertical size
     :param detector_num: detector quantity of this side
     :param fighter_num: fighter quantity of this side
     """
     BaseAgent.__init__(self)
     self.obs_ind = 'airc_homo_rule'
     self.last_random_action_set = {}
     self.to_explore_set = {}
     self.explore_destination_set = {}
     self.rule_set = 'attack'
コード例 #5
0
 def __init__(self):
     """
     Init this agent
     :param size_x: battlefield horizontal size
     :param size_y: battlefield vertical size
     :param detector_num: detector quantity of this side
     :param fighter_num: fighter quantity of this side
     """
     BaseAgent.__init__(self)
     # self.preposs = [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0],
     #            [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
     self.obs_ind = OBS_IND_NAME
     if not os.path.exists('model/{}/{}.pkl'.format(MODEL_PATH_AGENT,
                                                    MODEL_NAME_AGENT)):
         logger.info('Error: agent maddpg4 model data not exist!')
         exit(1)
     self.fighter_model = dqn.RLFighter(OBS_NUM, ACTION_NUM)
     self.step = 0
コード例 #6
0
ファイル: agent.py プロジェクト: OldFuzzier/mymaca
 def __init__(self):
     """
     Init this agent
     :param size_x: battlefield horizontal size
     :param size_y: battlefield vertical size
     :param detector_num: detector quantity of this side
     :param fighter_num: fighter quantity of this side
     """
     BaseAgent.__init__(self)
     # self.preposs = [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0],
     #            [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
     self.obs_ind = 'dqn_jy'
     if not os.path.exists('model/dqn_jy/model_000015200.pkl'):
         print(
             'class Agent(BaseAgent) Error: agent test1 model data not exist!'
         )
         exit(1)
     self.fighter_model = dqn.RLFighter(ACTION_NUM)