Bratmobile
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
AttentiveConfigurator Class Reference

Configurator with long-range planning. It explores transitions out of a state until a DEFAULT Task is reached. The next state to expand will be the one with lowest heuristic cost. More...

#include <attentive.h>

Inheritance diagram for AttentiveConfigurator:
Inheritance graph
[legend]
Collaboration diagram for AttentiveConfigurator:
Collaboration graph
[legend]

Classes

class  EvaluationQueueManager
 Adds and removes vertices from the evaluation queue. More...
 

Public Member Functions

 AttentiveConfigurator (Task _task)
 
- Public Member Functions inherited from Configurator
 Configurator (Task _task)
 
virtual void init (Task _task=Task())
 Initialises configurator. More...
 
virtual bool Spawner ()
 Calls functions to explore the state space and extract a plan. More...
 
int getIteration ()
 
void addIteration (int i=1)
 
void assignDisturbanceToTask (const Disturbance &d, Task &t)
 
void dummy_vertex (vertexDescriptor src)
 
simResult simulate (Task t, b2World &w)
 Simulates this task, includes creating the robot object. More...
 
virtual float remainingSimulationTime (const Task *const t=NULL)
 
void estimate_current_vertex ()
 
void printPlan (std::vector< vertexDescriptor > *p=NULL)
 
std::pair< edgeDescriptor, bool > addVertex (const vertexDescriptor &src, vertexDescriptor &v1, Edge edge=Edge(), bool topDown=0)
 Add state to the cognitive map and set next state Task direction and options. More...
 
void start ()
 
void stop ()
 
void registerInterface (LIDAR_In *, Motor_Out *)
 
virtual void change_task ()
 changes tasks executing on the robot
 
void update_graph (TransitionSystem &g, const TrackingResult &tr)
 
float approximate_angle (float angle, Direction d, simResult::resultType outcome)
 Approximating angle to divisors of pi/2. More...
 
virtual void adjust_goal_expectation ()
 Uses tracking information to adjust the position of the goal relative to the robot.
 
std::pair< bool, Direction > getOppositeDirection (Direction d)
 
void adjust_simulated_task (const vertexDescriptor &v, Task &t)
 If Task. More...
 
void register_controller (Controller *controller)
 
Controllerget_controller ()
 
void register_tracker (Tracker *_tracker)
 registers and initialises the tracker to the goal
 
Trackerget_tracker () const
 
Motor_Outget_motor_interface ()
 
LIDAR_Inget_lidar_interface ()
 
void register_planner (Planner *_p)
 
void setSimulationStep (float f)
 
void register_logger (Logger *l)
 
void register_goalChanger (GoalChanger *gc)
 
bool areInterfacesSetUp (Configurator *c=NULL)
 
void assignBodyFeatures (Task &t, const BodyFeatures &bf)
 Assigns body features to the disturbance of a task (NOTE: affordance and validity of the disturbance will remain the same) More...
 
void assignDimensions (Task &t, float halfLength, float halfWidth)
 Assigns dimensions to the disturbance of a task (NOTE: pose, affordance and validity of the disturbance will remain the same) More...
 
void register_worldBuilder (WorldBuilder *wb)
 
b2Transform get_start (const Task *const t)
 
Direction get_direction (const Task *const t)
 

Protected Member Functions

ExecutionInfo package_info (vertexDescriptor gv=TransitionSystem::null_vertex(), bool been=false)
 Package task/goal execution details into an Execution Info instance. More...
 
virtual Disturbance getDisturbance (TransitionSystem &g, vertexDescriptor v, b2World &world, const Direction &dir, const b2Transform &start)
 Use attention window to find if any previously avoided obstacle is in the way of the goal, if present. In case of plan recycling, it shifts the disturbance to adapt to the current task ahead. More...
 
virtual void backtrack (std::vector< vertexDescriptor > &evaluation_q, std::vector< vertexDescriptor > &priority_q, std::set< vertexDescriptor > &closed, std::vector< vertexDescriptor > &plan_prov, vertexDescriptor module_src=MOVING_VERTEX, vertexDescriptor startRecycle=MOVING_VERTEX)
 Iterates through vertices, if they result in crash, it splits the tasks and recalculates evaluation functions and adds to priority queue. More...
 
virtual std::vector< vertexDescriptor > splitTask (vertexDescriptor v, Direction d, vertexDescriptor src=TransitionSystem::null_vertex())
 Split tasks into sub-states of fixed length. More...
 
virtual bool propagateD (vertexDescriptor v1, vertexDescriptor v0, std::set< vertexDescriptor > *closed=NULL, StateMatcher::MATCH_TYPE match=StateMatcher::_FALSE)
 Propagate a disturbance backwards to all states representing the same task (max 1) More...
 
void planPriority (TransitionSystem &, vertexDescriptor)
 
void adjust_rw_task (const vertexDescriptor &, TransitionSystem &, Task *, const b2Transform &)
 
virtual VertexMatch findMatch (State s, Direction dir=Direction::UNDEFINED, StateMatcher::MATCH_TYPE match_type=StateMatcher::_TRUE, StateDifference *_sd=NULL, std::vector< VertexMatch > *other_matches=NULL)
 Searches transition System for a match to a state provided. Continuous states are matched, with the option to also match the discrete state (the direction) More...
 
virtual std::vector< vertexDescriptor > explorer (vertexDescriptor v, TransitionSystem &g, b2World &w)
 Constructs transition system using a Box2D simulation combined with an A* graph expansion algorithm. More...
 
void resetPhi ()
 Resets all vertices evaluation function phi to a default unitialised value of 10.
 
std::pair< edgeDescriptor, bool > add_vertex_now (const vertexDescriptor &src, vertexDescriptor &v1, Disturbance obs, Edge edge=Edge(), bool topDown=0)
 Adds state after discovering it in exploration. More...
 
std::pair< edgeDescriptor, bool > add_vertex_retro (vertexDescriptor &src, vertexDescriptor &v1, Edge edge=Edge(), bool topDown=0)
 Adds vertices retroactively (e.g. after a state is split) More...
 
std::vector< Direction > getExploredDirections (vertexDescriptor v, const std::vector< Direction > &directions)
 
virtual void removeExploredTransitions (vertexDescriptor v)
 
virtual void transitionMatrix (vertexDescriptor v, Direction d, vertexDescriptor src)
 
void applyTransitionMatrix (vertexDescriptor v0, Direction d, bool ended, vertexDescriptor src, std::vector< vertexDescriptor > &plan_prov)
 Sets permitted transitions out of a state, formally combines jump guard J and guard Psi. More...
 
void addToPriorityQueue (vertexDescriptor v, std::vector< vertexDescriptor > &queue, const std::set< vertexDescriptor > &closed)
 Adds vertexDescriptor to priority queue according to a custom heuristic. More...
 
void ts_cleanup ()
 
void shift_states (TransitionSystem &, const std::vector< vertexDescriptor > &, const b2Transform &)
 
vertexDescriptor get_explore_start (TransitionSystem &)
 
void pre_explore ()
 Prepares transitionsystem for exploration: clears all edges of q0 with states that aren't the current one and updates instantaneous state q0 (vertex 0) with info about the Task in execution.
 
void explore_plan (b2World &) override
 Explores and plan.
 
std::vector< Direction >::iterator get_next_option (vertexDescriptor v, vertexDescriptor src, std::vector< vertexDescriptor > full_plan)
 Returns an iterator to the next option representing a discrete Task transition. If v is in the plan, returns the next task in the plan. If this next task is successful, after that option has been simulated it returns iterator to vector end. If not, returns other options. More...
 
virtual bool recycle_plan (vertexDescriptor v, vertexDescriptor &v0, vertexDescriptor &task_start, StateMatcher::MATCH_TYPE &matchType, b2Transform &shift_start, b2Transform &sk_first_start, std::pair< edgeDescriptor, bool > &edge, std::vector< vertexDescriptor > &plan_prov, Direction t_get_direction)
 Assesses whether a previous plan can be recycled. More...
 
std::pair< State, Edgesimulation_setup (b2World &w, Task &t, vertexDescriptor v0, b2Transform shift, b2Transform &start, std::vector< Direction >v0_options)
 Sets up for simulation. More...
 
void reassign_direction (vertexDescriptor bestNext, Direction &direction)
 Reassigns direction as the direction of the bext task to expand next in explorer. More...
 
bool matchToSafe (VertexMatch &match, const std::vector< VertexMatch > &other_matches=std::vector< VertexMatch >())
 if the match is a crashed task More...
 
std::pair< edgeDescriptor, bool > setup_match_edge (VertexMatch &match, vertexDescriptor &v0, vertexDescriptor &v1, const Edge &k, Direction direction, bool changedMatch)
 Given a valid match, sets up the edge with the previous vertex Creates new edge if it doesn't exist, changes the match to a safe state and allow the edge to be used in planning. More...
 
virtual std::vector< vertexDescriptor > task_vertices (vertexDescriptor v, std::pair< bool, edgeDescriptor > *ep=NULL)
 Rerturns all the vertices making up a task. More...
 
vertexDescriptor getRecyclingStart (vertexDescriptor v, vertexDescriptor v1, vertexDescriptor taskStart)
 Returns the vertex from which to start recycling plan. More...
 
std::vector< edgeDescriptor > inEdges (vertexDescriptor v, Direction d=UNDEFINED)
 Returns a vector of all the in-edges of vertex. More...
 
virtual bool closeVertex (std::set< vertexDescriptor > &closed, vertexDescriptor v)
 
std::pair< edgeDescriptor, bool > addEdgeRetrospectively (vertexDescriptor v, vertexDescriptor &v1, const State &s_tmp, std::pair< edgeDescriptor, bool > first_edge, Direction d, float linearSpeed)
 Adds edge retrospectively (used in split task) More...
 
void correctQueue (std::vector< vertexDescriptor > &queue, vertexDescriptor v, vertexDescriptor startRecycle, int planProvSize)
 Edits. More...
 
void adjustProbability (const edgeDescriptor &e)
 Adjusts the probability that a continuous state (edge target) will occur after taking a discrete state transition from the edge source. More...
 
void abandonPlan (std::vector< vertexDescriptor > &planProv, vertexDescriptor v0, vertexDescriptor v1)
 Clears plan vector, sets current task to change and clears current vertices. More...
 
virtual std::vector< Direction > partiallyExplorativeOptions (std::pair< bool, edgeDescriptor > ve)
 Assigns options to vertex which has in previous iteration been expanded. Assigns direction of successful current task, or direction of other tasks if unsuccessful. More...
 
virtual Robot makeRobot (b2World &w, const b2Transform &start)
 Makes the robot object in the world with the given start position and task. More...
 
void visitedDirectionsPushBack (vertexDescriptor v, std::vector< Direction > &visitedDirections, Direction direction)
 Pushes directions visited at this iteration (not using phi) to input vector. More...
 
virtual StateMatcher::MATCH_TYPE desiredMatch ()
 
void enforce_edge ()
 Used to make sure that there is always a connection between DUMMY/MOVING to the next in plan - useful in sudden changes of plans.
 
virtual bool shouldPartiallyExplore (const std::vector< edgeDescriptor > &oe, std::pair< bool, edgeDescriptor > ve)
 Psi guard: should only current task be simulated?
 
virtual bool canPropagate (vertexDescriptor v)
 propagates only if the previous vertex More...
 
virtual bool canReassignOutcome (vertexDescriptor v)
 
virtual float customSimulationStep (vertexDescriptor v=TransitionSystem::null_vertex())
 

Protected Attributes

StateMatcher matcher
 
- Protected Attributes inherited from Configurator
int iteration =0
 
int simulatedTasks =0
 
Task currentTask
 
Controllertask_controller =NULL
 
Trackertracker =NULL
 
LIDAR_Inci =NULL
 
Motor_Outcontrol =NULL
 
Plannerplanner =NULL
 
Loggerlogger =NULL
 
bool running =0
 
std::thread * LIDAR_thread =NULL
 
float simulationStep =2*std::max(ROBOT_HALFLENGTH, ROBOT_HALFWIDTH)
 
std::chrono::high_resolution_clock::time_point previousTimeScan
 
GoalChangergoal_changer =NULL
 
std::vector< vertexDescriptor > m_plan
 
std::vector< vertexDescriptor > current_vertices
 
Task controlGoal
 
CoordinateContainer data2fp
 
TransitionSystem transitionSystem =TransitionSystem(1)
 
WorldBuilderworldBuilder =new WorldBuilder()
 
vertexDescriptor currentVertex =MOVING_VERTEX
 
edgeDescriptor movingEdge =edgeDescriptor()
 
edgeDescriptor currentEdge =movingEdge
 

Additional Inherited Members

- Static Public Member Functions inherited from Configurator
static void run (Configurator *)
 Spawns tasks, creates plans, tracks task and controls real-world task switching option to run in thread. Thread can be used if planning time might exceed 200ms (LIDAR sampling rate) but doesn't have to be.
 
static void MulT (const b2Transform &B, Task &task)
 Matrix multiply by transpose.
 
static void InvMul (const b2Transform &B, Task &task)
 Matrix multiply by transpose.
 
static void InvMul_ (const b2Transform &B, Task &task)
 Matrix multiply by transpose.
 
static void Mul (const b2Transform &B, Task &task)
 Matrix multiplication.
 

Detailed Description

Configurator with long-range planning. It explores transitions out of a state until a DEFAULT Task is reached. The next state to expand will be the one with lowest heuristic cost.

Member Function Documentation

◆ abandonPlan()

void AttentiveConfigurator::abandonPlan ( std::vector< vertexDescriptor > &  planProv,
vertexDescriptor  v0,
vertexDescriptor  v1 
)
protected

Clears plan vector, sets current task to change and clears current vertices.

Parameters
planProvprovisional plan as in the explorer

◆ add_vertex_now()

std::pair< edgeDescriptor, bool > AttentiveConfigurator::add_vertex_now ( const vertexDescriptor &  src,
vertexDescriptor &  v1,
Disturbance  obs,
Edge  edge = Edge(),
bool  topDown = 0 
)
protected

Adds state after discovering it in exploration.

Parameters
srcsource state
v1new state
Dithe initial disturbance of v1
edgeconnecting edge between src->v1
topDownflag determining whether state v1 has been simulated already or not

◆ add_vertex_retro()

std::pair< edgeDescriptor, bool > AttentiveConfigurator::add_vertex_retro ( vertexDescriptor &  src,
vertexDescriptor &  v1,
Edge  edge = Edge(),
bool  topDown = 0 
)
protected

Adds vertices retroactively (e.g. after a state is split)

Parameters
srcsource state
v1new state
edgeconnecting edge between src->v1
topDownflag determining whether state v1 has been simulated already or not

◆ addEdgeRetrospectively()

std::pair< edgeDescriptor, bool > AttentiveConfigurator::addEdgeRetrospectively ( vertexDescriptor  v,
vertexDescriptor &  v1,
const State s_tmp,
std::pair< edgeDescriptor, bool >  first_edge,
Direction  d,
float  linearSpeed 
)
protected

Adds edge retrospectively (used in split task)

Parameters
vsource
v1target
s_tmp_endPoseendPose for the new sub-state
first_edgeoriginal unsplit task edge
Directiond
Returns
std::pair<edgeDescriptor, bool>

◆ addToPriorityQueue()

void AttentiveConfigurator::addToPriorityQueue ( vertexDescriptor  v,
std::vector< vertexDescriptor > &  queue,
const std::set< vertexDescriptor > &  closed 
)
protected

Adds vertexDescriptor to priority queue according to a custom heuristic.

Parameters
vthe vertex descriptor for the state
queuethe priority queue
gthe transition system
closedclosed states: ones which have already been simulated and expanded

◆ adjustProbability()

void AttentiveConfigurator::adjustProbability ( const edgeDescriptor &  e)
protected

Adjusts the probability that a continuous state (edge target) will occur after taking a discrete state transition from the edge source.

Parameters
ean edge descriptor

◆ applyTransitionMatrix()

void AttentiveConfigurator::applyTransitionMatrix ( vertexDescriptor  v0,
Direction  d,
bool  ended,
vertexDescriptor  src,
std::vector< vertexDescriptor > &  plan_prov 
)
protected

Sets permitted transitions out of a state, formally combines jump guard J and guard Psi.

Parameters
v0vertex descriptor for source state
ddirection of state (to be removed later)
endedwhether the overarching goal has ended
srcsource vertex of v0
plan_provthe plan

◆ backtrack()

void AttentiveConfigurator::backtrack ( std::vector< vertexDescriptor > &  evaluation_q,
std::vector< vertexDescriptor > &  priority_q,
std::set< vertexDescriptor > &  closed,
std::vector< vertexDescriptor > &  plan_prov,
vertexDescriptor  module_src = MOVING_VERTEX,
vertexDescriptor  startRecycle = MOVING_VERTEX 
)
protectedvirtual

Iterates through vertices, if they result in crash, it splits the tasks and recalculates evaluation functions and adds to priority queue.

Parameters
evaluation_qevaluation queue: lists of vertices to be evaluated for splitting
priority_qthe priority queue to add vertices to
closedclosed set
plan_provprovisional plan
module_srcsource vertex from which modular expansion began
startRecyclevertex from which plan recycling started (for correcting pq)

Reimplemented in B2BConfigurator, and DiscreteConfigurator.

◆ canPropagate()

bool AttentiveConfigurator::canPropagate ( vertexDescriptor  v)
protectedvirtual

propagates only if the previous vertex

Parameters
vis a dummy vertex, but can be customised

Reimplemented in DiscreteConfigurator.

◆ correctQueue()

void AttentiveConfigurator::correctQueue ( std::vector< vertexDescriptor > &  queue,
vertexDescriptor  v,
vertexDescriptor  startRecycle,
int  planProvSize 
)
protected

Edits.

Parameters
vout of the queue if the plan was recycled from a different vertex. Useful if the frontier of
vresults in a crash and a plan needs to be recycled from the state previous to it
queuequeue
vsource v (which may have a crash in its frontier)
startRecycleanother state found to precede the frontier
planProvSizesize of the provisional plan: indicates if the recycling was successful or not

◆ explorer()

std::vector< vertexDescriptor > AttentiveConfigurator::explorer ( vertexDescriptor  v,
TransitionSystem &  g,
b2World &  w 
)
protectedvirtual

Constructs transition system using a Box2D simulation combined with an A* graph expansion algorithm.

Parameters
vstarting vertex
gthe transition system
wbox2d world
Returns
std::vector<vertexDescriptor> a plan, if recycled from previous knowledge

Reimplemented in B2BConfigurator.

◆ findMatch()

VertexMatch AttentiveConfigurator::findMatch ( State  s,
Direction  dir = Direction::UNDEFINED,
StateMatcher::MATCH_TYPE  match_type = StateMatcher::_TRUE,
StateDifference _sd = NULL,
std::vector< VertexMatch > *  other_matches = NULL 
)
protectedvirtual

Searches transition System for a match to a state provided. Continuous states are matched, with the option to also match the discrete state (the direction)

Parameters
sthe state to find a match for
dirsimulated task direction (allowing to match continuous states only)
match_typefuzzy operator indicating what parameters in the continuous state match
_sdpointer to state difference, can be used for further calculatins
other_matchespointer to a vector of other matches (all of the type defined by
match_type)
Returns
VertexMatch the best match found and its type

Reimplemented in DiscreteConfigurator, and FocusedConfigurator.

◆ get_next_option()

std::vector<Direction>::iterator AttentiveConfigurator::get_next_option ( vertexDescriptor  v,
vertexDescriptor  src,
std::vector< vertexDescriptor >  full_plan 
)
protected

Returns an iterator to the next option representing a discrete Task transition. If v is in the plan, returns the next task in the plan. If this next task is successful, after that option has been simulated it returns iterator to vector end. If not, returns other options.

Parameters
vvertex being expanded
srcv's source vertex
full_plana plan
Returns
std::vector<Direction>::iterator

◆ getDisturbance()

Disturbance AttentiveConfigurator::getDisturbance ( TransitionSystem &  g,
vertexDescriptor  v,
b2World &  world,
const Direction &  dir,
const b2Transform &  start 
)
protectedvirtual

Use attention window to find if any previously avoided obstacle is in the way of the goal, if present. In case of plan recycling, it shifts the disturbance to adapt to the current task ahead.

Parameters
gthe transition system
vsource vertex
worldbox2d world
dirdirection of the task to be simulated
starttask start
Returns
previous Di if it's in the way of target, even though source task was successful previous Dn if previous task is safe for now goal Di otherwise

Reimplemented in B2BConfigurator, and DiscreteConfigurator.

◆ getExploredDirections()

std::vector< Direction > AttentiveConfigurator::getExploredDirections ( vertexDescriptor  v,
const std::vector< Direction > &  directions 
)
protected
  • returns a vector of which directions in vector
    Parameters
    directionswere explored (at the present iteration) from vertex
    v

◆ getRecyclingStart()

vertexDescriptor AttentiveConfigurator::getRecyclingStart ( vertexDescriptor  v,
vertexDescriptor  v1,
vertexDescriptor  taskStart 
)
protected

Returns the vertex from which to start recycling plan.

Parameters
vsource vertex which is being expanded
v1last vertex in task, or the match
taskStartstart of the task
Returns
Parameters
vif the task is successful,
connectingEdgeif it ends in crash

◆ inEdges()

std::vector< edgeDescriptor > AttentiveConfigurator::inEdges ( vertexDescriptor  v,
Direction  d = UNDEFINED 
)
protected

Returns a vector of all the in-edges of vertex.

Parameters
v.Option to enter
dto select a subset of edge. Does not return self-edges
Returns
std::vector <edgeDescriptor>

◆ makeRobot()

Robot AttentiveConfigurator::makeRobot ( b2World &  world,
const b2Transform &  start 
)
protectedvirtual

Makes the robot object in the world with the given start position and task.

Parameters
world
start
taskWithGoal
Returns
Robot

Reimplemented from Configurator.

Reimplemented in DiscreteConfigurator.

◆ matchToSafe()

bool AttentiveConfigurator::matchToSafe ( VertexMatch &  match,
const std::vector< VertexMatch > &  other_matches = std::vector<VertexMatch>() 
)
protected

if the match is a crashed task

Parameters
match
other_matches
Returns
true if changes match

◆ package_info()

ExecutionInfo AttentiveConfigurator::package_info ( vertexDescriptor  gv = TransitionSystem::null_vertex(),
bool  been = false 
)
inlineprotected

Package task/goal execution details into an Execution Info instance.

Parameters
gvgoal vertex
beenhas goal been visited
Returns
Planner::ExecutionInfo

◆ partiallyExplorativeOptions()

std::vector< Direction > AttentiveConfigurator::partiallyExplorativeOptions ( std::pair< bool, edgeDescriptor >  ve)
protectedvirtual

Assigns options to vertex which has in previous iteration been expanded. Assigns direction of successful current task, or direction of other tasks if unsuccessful.

Parameters
vea visited edge and whetehr it exists

Reimplemented in DiscreteConfigurator.

◆ propagateD()

bool AttentiveConfigurator::propagateD ( vertexDescriptor  v1,
vertexDescriptor  v0,
std::set< vertexDescriptor > *  closed = NULL,
StateMatcher::MATCH_TYPE  match = StateMatcher::_FALSE 
)
protectedvirtual

Propagate a disturbance backwards to all states representing the same task (max 1)

Parameters
v1final vertex linked to the final sub-state in the task
v0source of v1
closedclosed set
matchis v1 a match of any kind to a vertex in the graph
Returns
whether a criteria to continue propagating is met

Reimplemented in DiscreteConfigurator.

◆ reassign_direction()

void AttentiveConfigurator::reassign_direction ( vertexDescriptor  bestNext,
Direction &  direction 
)
protected

Reassigns direction as the direction of the bext task to expand next in explorer.

Parameters
bestNextvertices representing task with lowest phi
directiondirection to reassign

◆ recycle_plan()

bool AttentiveConfigurator::recycle_plan ( vertexDescriptor  v,
vertexDescriptor &  v0,
vertexDescriptor &  task_start,
StateMatcher::MATCH_TYPE &  matchType,
b2Transform &  shift_start,
b2Transform &  sk_first_start,
std::pair< edgeDescriptor, bool > &  edge,
std::vector< vertexDescriptor > &  plan_prov,
Direction  t_get_direction 
)
protectedvirtual

Assesses whether a previous plan can be recycled.

Parameters
vsource vertex (start of module)
v0vertex currently expanded
task_startvertex representing the start of the provisional plan
matchTypematch type of matching operation
shift_startvector to shift future start by
sk_first_startstart of the state just simulated (sk.first)
edgeedge between v0 and the new state (v1)
plan_provprovisional plan
t_get_directiondirection of the task just simulated
Returns
true
false

Reimplemented in DiscreteConfigurator, and FocusedConfigurator.

◆ removeExploredTransitions()

void AttentiveConfigurator::removeExploredTransitions ( vertexDescriptor  v)
protectedvirtual
  • only keeps unexplored transitions out of vertex
    Parameters
    v

Reimplemented in DiscreteConfigurator, and FocusedConfigurator.

◆ setup_match_edge()

std::pair< edgeDescriptor, bool > AttentiveConfigurator::setup_match_edge ( VertexMatch &  match,
vertexDescriptor &  v0,
vertexDescriptor &  v1,
const Edge k,
Direction  direction,
bool  changedMatch 
)
protected

Given a valid match, sets up the edge with the previous vertex Creates new edge if it doesn't exist, changes the match to a safe state and allow the edge to be used in planning.

Parameters
match
v0
v1
k
direction
Returns
std::pair<edgeDescriptor, bool>

◆ simulation_setup()

std::pair< State, Edge > AttentiveConfigurator::simulation_setup ( b2World &  w,
Task t,
vertexDescriptor  v0,
b2Transform  shift,
b2Transform &  start,
std::vector< Direction >  v0_options 
)
protected

Sets up for simulation.

Parameters
Wbox2d world
ttask (gets modified)
v0source vertex for the next state
shiftany shift to be applied (in case of plan recycling)
starttask start
v0_optionsa subset of transitionSystem[0].options
Returns
sk, pair of state and edge

◆ splitTask()

std::vector< vertexDescriptor > AttentiveConfigurator::splitTask ( vertexDescriptor  v,
Direction  d,
vertexDescriptor  src = TransitionSystem::null_vertex() 
)
protectedvirtual

Split tasks into sub-states of fixed length.

Parameters
vthe vertex to split
ddirection of the task to split
srcsource vertex for v
Returns
std::vector <vertexDescriptor> : the vertices making up substates in the original task

//&& sameIterationEdgeIt!=ie.end()

Reimplemented in B2BConfigurator.

◆ task_vertices()

std::vector< vertexDescriptor > AttentiveConfigurator::task_vertices ( vertexDescriptor  v,
std::pair< bool, edgeDescriptor > *  ep = NULL 
)
protectedvirtual

Rerturns all the vertices making up a task.

Parameters
va vertex representing a state
epconnecting edge to vertex v

◆ transitionMatrix()

void AttentiveConfigurator::transitionMatrix ( vertexDescriptor  v,
Direction  d,
vertexDescriptor  src 
)
protectedvirtual

From Neural Comp paper: combines edges K with guard Psi

Parameters
vthe vertex to which transitions are being assigned
dstate direction (redundant)
srcsource vertex of state

Reimplemented in DiscreteConfigurator.

◆ visitedDirectionsPushBack()

void AttentiveConfigurator::visitedDirectionsPushBack ( vertexDescriptor  v,
std::vector< Direction > &  visitedDirections,
Direction  direction 
)
protected

Pushes directions visited at this iteration (not using phi) to input vector.

Parameters
vvertex
visitedDirectionsinput vector

The documentation for this class was generated from the following files: