예제 #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)