Skip to content

Class cowboys::GraphBuilder

ClassList > cowboys > GraphBuilder

A class for building graphs. Graphs are a generic representation, so this class is used to build the specific format of a Cartesian Graph , and also preset graphs.

  • #include <GraphBuilder.hpp>

Public Functions

Type Name
std::unique_ptr< Graph > CartesianGraph (const CGPGenotype & genotype, const std::vector< InnerFunction > & function_set, const cse491::AgentBase * agent=nullptr)
Creates a decision graph from a CGP genotype.
GraphBuilder () = default
std::unique_ptr< Graph > VerticalPacer ()
Creates a decision graph for pacing up and down in a MazeWorld. Assumes that the inputs are in the format: prev_action, current_state, above_state, below_state, left_state, right_state.
~GraphBuilder () = default

Public Functions Documentation

function CartesianGraph

Creates a decision graph from a CGP genotype.

inline std::unique_ptr< Graph > cowboys::GraphBuilder::CartesianGraph (
    const CGPGenotype & genotype,
    const std::vector< InnerFunction > & function_set,
    const cse491::AgentBase * agent=nullptr
) 

Parameters:

  • genotype The genotype to create the decision graph from.
  • function_set The set of functions available to the decision graph.
  • agent The agent that will be using the decision graph.

Returns:

The decision graph.

function GraphBuilder

cowboys::GraphBuilder::GraphBuilder () = default

function VerticalPacer

Creates a decision graph for pacing up and down in a MazeWorld. Assumes that the inputs are in the format: prev_action, current_state, above_state, below_state, left_state, right_state.

inline std::unique_ptr< Graph > cowboys::GraphBuilder::VerticalPacer () 

Parameters:

  • action_vec Assumes that the action outputs are in the format: up, down, left, right

Returns:

The decision graph for a vertical pacer.

function ~GraphBuilder

cowboys::GraphBuilder::~GraphBuilder () = default

The documentation for this class was generated from the following file source/Agents/GP/GraphBuilder.hpp