Skip to content

Class walle::RandomAgent

ClassList > walle > RandomAgent

More...

  • #include <RandomAgent.hpp>

Inherits the following classes: AgentBase

Public Functions

Type Name
void CalculateRandom (double multiplier)
Function to calculate the random direction.
bool GetMoving () const
Get the Moving object.
double GetRandom () const
Get the Random object.
bool Initialize () override
This agent needs a specific set of actions to function.
RandomAgent (size_t id, const std::string & name)
Is the agent moving?
size_t SelectAction (const cse491::WorldGrid &, const cse491::type_options_t &, const cse491::item_map_t &, const cse491::agent_map_t &) override
Choose the action to take a step in the random direction.
void SetDirection (double direction)
Set the Direction object.
void SetMoving (bool move)
Set the Moving object.
~RandomAgent () = default

Detailed Description

Class for the Random Agent

Public Functions Documentation

function CalculateRandom

Function to calculate the random direction.

inline void walle::RandomAgent::CalculateRandom (
    double multiplier
) 

Parameters:

  • multiplier double: random multiplier

function GetMoving

Get the Moving object.

inline bool walle::RandomAgent::GetMoving () const

Returns:

true

Returns:

false

function GetRandom

Get the Random object.

inline double walle::RandomAgent::GetRandom () const

Returns:

double random member variable

function Initialize

This agent needs a specific set of actions to function.

inline bool walle::RandomAgent::Initialize () override

Returns:

Success.

function RandomAgent

Is the agent moving?

inline walle::RandomAgent::RandomAgent (
    size_t id,
    const std::string & name
) 

Construct a new Random Agent object

Parameters:

  • id id of the agent
  • name name of the agent

function SelectAction

inline size_t walle::RandomAgent::SelectAction (
    const cse491::WorldGrid &,
    const cse491::type_options_t &,
    const cse491::item_map_t &,
    const cse491::agent_map_t &
) override

function SetDirection

Set the Direction object.

inline void walle::RandomAgent::SetDirection (
    double direction
) 

Parameters:

  • direction direction to set

function SetMoving

Set the Moving object.

inline void walle::RandomAgent::SetMoving (
    bool move
) 

Parameters:

  • move move to set

function ~RandomAgent

walle::RandomAgent::~RandomAgent () = default

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