def new_move(self, action=None, group=0, x_range=(0.0, WORLD_WIDTH), y_range=(0.0, WORLD_HEIGHT), vector=(0.0, 0.0), angle=0.0, factor=0.0, max_speed=0.0, max_angular_speed=0.0, vehicle_type=None, facility_id=-1, vehicle_id=-1): m = Move() m.action = action m.group = group m.left, m.right = x_range m.top, m.bottom = y_range m.x, m.y = vector m.angle = angle m.factor = factor m.max_speed = max_speed m.max_angular_speed = max_angular_speed m.vehicle_type = vehicle_type m.facility_id = facility_id m.vehicle_id = vehicle_id return m
def do_group(s: MyStrategy, w: World, g: Game, m: Move): m.action = action m.group = gnum if action == ActionType.ASSIGN: s.free_groups.discard(gnum) elif action == ActionType.DISBAND: s.free_groups.add(gnum)
def do_select(s: MyStrategy, w: World, g: Game, m: Move, a=area): m.action = action #print("Selecting: " + str(a)) m.left = a.left - fuzz m.right = a.right + fuzz m.top = a.top m.bottom = a.bottom m.group = group m.vehicle_type = vtype