rj_gameplay.tactic.clear_tactic

Module Contents

Classes

ClearerCost

A cost function for how to choose a robot that will clears

Clear

A passing tactic which captures then passes the ball

class rj_gameplay.tactic.clear_tactic.ClearerCost

Bases: stp.role.CostFn

A cost function for how to choose a robot that will clears

__call__(robot: stp.rc.Robot, prev_result: stp.role.RoleResult | None, world_state: stp.rc.WorldState) float

Given a robot and the current world state, returns the cost of assigning that robot to a given role. :param robot: The current robot to check costs for. :param world_state: The current world state. :return:

unassigned_cost_fn(prev_result: stp.role.RoleResult | None, world_state: stp.rc.WorldState) float

Given the previous role assigment and current world state, returns the cost of not assigning any robot. :param prev_result: The previous role assignment result. :param world_state: The current world state. :return: cost of not assigning

class rj_gameplay.tactic.clear_tactic.Clear(target_point: numpy.ndarray, kick_speed=3.0, chip=False)

Bases: stp.tactic.ITactic

A passing tactic which captures then passes the ball

compute_props()
create_request(**kwargs) stp.role.RoleRequest

Creates a sane default RoleRequest. :return: A list of size 1 of a sane default RoleRequest.

get_requests(world_state: stp.rc.WorldState, props) List[stp.tactic.RoleRequests]

Checks if we have the ball and returns the proper request :return: A list of size 2 of role requests

tick(world_state: stp.rc.WorldState, role_results: stp.tactic.RoleResults) List[stp.tactic.SkillEntry]
Returns:

A list of size 1 or 2 skills depending on which roles are filled and state of aiming

TODO: Come up with better timings for starting receive

is_done(world_state: stp.rc.WorldState)