def __init__(self, tank_index, target_color, state): self.state = state self.target_color = target_color self.tank_index = tank_index self.pdc = PDController() self.timer_id = Timer.add_task(self.update) self.kvis = KalmanVisualizer(800, 800) self.kfilter = KalmanFilter()
def __init__(self, tank_index, flag_index, state): self.tank_index = tank_index self.flag_index = flag_index self.state = state self.timer_id = Timer.add_task(self.potential_fields_move) self.pfc = self.setup_potential_fields() self.pdcontroller = PDController() self.attacking = True self.prev_x = 0 self.prev_y = 0 self.time_spent_stuck = 0 # stuck for more than 10 seconds, get a new random vector self.time_without_moving = 0 # consider ourselves stuck only after 5 seconds self.stuck_vector = [0, 0] self.stuck = False
def __init__(self, tank_index, bay_vis, bay_filter, state): self.tank_index = tank_index self.state = state self.bay_vis = bay_vis self.bay_filter = bay_filter # the tank should change goals periodically self.time_since_goal_change = 0 self.goal_x = 0 self.goal_y = 0 self.pdcontroller = PDController() self.pfc = self.setup_potential_fields() # these variables are used to check if we're stuck self.time_without_moving = 0 self.prev_x = 0 self.prev_y = 0 self.timer_id = Timer.add_task(self.bayesian_grid_search)
def __init__(self, tank_index, state): self.tank_index = tank_index self.state = state self.timer_id = Timer.add_task(self.really_dumb_agent) self.count = 0