stp.tactic

Package Contents

Classes

ITactic

Helper class that provides a standard way to create an ABC using

Tactic

High-level construct that coordinates one or more roles. Creates role requests to be handled by Plays.

Attributes

RoleRequests

RoleResults

SkillEntry

class stp.tactic.ITactic

Bases: abc.ABC

Helper class that provides a standard way to create an ABC using inheritance.

stp.tactic.RoleRequests
stp.tactic.RoleResults
stp.tactic.SkillEntry
class stp.tactic.Tactic(world_state: stp.rc.WorldState)

Bases: abc.ABC

High-level construct that coordinates one or more roles. Creates role requests to be handled by Plays.

property role_requests: List[Tuple[stp.role.Role, stp.role.CostFn]]

Returns self._role_requests. @property allows the getter to be called like this:

some_tactic = ConcreteTactic() role_reqs = some_tactic.role_requests

property needs_assign
abstract init_roles(world_state: stp.rc.WorldState) None

Given assigned robots by the Play, initialize each role of role_requests with its assigned robot.

abstract tick(world_state: stp.rc.WorldState) List[Tuple[int, rj_msgs.msg.RobotIntent]]

Tick each Role of the Tactic to get a list of robot_ids and linked RobotIntents for the Play.

abstract is_done(world_state: stp.rc.WorldState) bool

True when Tactic is done; False otherwise.

set_assigned_robots(assigned_robots)
__repr__()

returns a string with all the roles requested and all the roles assigned.