Conscience Core
Classes | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
conscience_core::bridging::commands::CommandAreaAnalysis Class Reference

This class is made to allow entities to explore a given area. An entity will follow a "boustrophedon path" for each trapezoidal cell in an area, it will start from a corner of a cell, following the boundary in a straight line, it will reach another corner, there it will rotate 180° and follow a straight line parallel to the first, and it will repeat these actions as soons as it reach a boundary. More...

#include <CommandAreaAnalysis.h>

Inheritance diagram for conscience_core::bridging::commands::CommandAreaAnalysis:
conscience_core::bridging::commands::CscCommand

Public Member Functions

 CommandAreaAnalysis (ptr< CscEntityReflexion > entityReflexion, vector< const CscPoint3d * > areaVertices, vector< vector< const CscPoint3d * >> holes, double areaOfPerceptionWidth, const CscPoint3d *entityPosition, optional< bool > doNotPlay)
 
 ~CommandAreaAnalysis () override
 
- Public Member Functions inherited from conscience_core::bridging::commands::CscCommand
const CscCommandExecutionResult_execute (CscEnvironmentSimulator &environmentSimulator)
 
template<class TResult = CscCommandExecutionResult>
const TResult * execute (CscEnvironmentSimulator &environmentSimulator)
 
const CommandTypeIdgetTypeId () const
 
virtual ~CscCommand ()
 
void setOriginalCommandString (string command)
 

Static Public Attributes

static const CommandTypeId COMMAND_ID = "AREA_ANALYSIS"
 

Protected Member Functions

ptr< CscEntityReflexiongetEntityReflexion () const override
 
const CscCommandExecutionResultSequencedoExecute (CscEnvironmentSimulator &environmentSimulator) override
 
- Protected Member Functions inherited from conscience_core::bridging::commands::CscCommand
 CscCommand (const CommandTypeId &typeId)
 
const CscCommandExecutionResultNoneresultNone ()
 
const CscCommandExecutionResultSequenceresultSequence (CscSequence *sequence, const string &entitySerialNumber, bool doNotPlay=false)
 
const CscCommandExecutionResultFileresultFile (const fs::path &resultingFilePath)
 
template<class TResult >
const CscCommandExecutionResultObject< TResult > * resultObject (TResult *result)
 
const CscWorldElementId getEntityId () const
 

Protected Attributes

ptr< CscEntityReflexionentityReflexion
 
- Protected Attributes inherited from conscience_core::bridging::commands::CscCommand
const CommandTypeId typeId
 
optional< string > originalCommandString = {}
 

Additional Inherited Members

- Public Types inherited from conscience_core::bridging::commands::CscCommand
typedef function< void(CscCommand *command)> CommandExecutedListener
 
- Static Public Member Functions inherited from conscience_core::bridging::commands::CscCommand
static void addCommandExecutedListener (CommandExecutedListener listener)
 

Detailed Description

This class is made to allow entities to explore a given area. An entity will follow a "boustrophedon path" for each trapezoidal cell in an area, it will start from a corner of a cell, following the boundary in a straight line, it will reach another corner, there it will rotate 180° and follow a straight line parallel to the first, and it will repeat these actions as soons as it reach a boundary.

Work In Progress : implementing algorithm for concave areas and areas with obstacles

Constructor & Destructor Documentation

◆ CommandAreaAnalysis()

conscience_core::bridging::commands::CommandAreaAnalysis::CommandAreaAnalysis ( ptr< CscEntityReflexion entityReflexion,
vector< const CscPoint3d * >  areaVertices,
vector< vector< const CscPoint3d * >>  holes,
double  areaOfPerceptionWidth,
const CscPoint3d entityPosition,
optional< bool >  doNotPlay 
)
Parameters
areaVerticesVertices of the polygon, needs to contains more than 2 vertices (else it won't be a polygon), and they need to be in order, the last element of the vector forms an edge with the first, the first with the second...
areaOfPerceptionWidthwidth of area an entity can "scan" at a position, the class is really sensible with this parameter as it is used to discretize a polygon (too low and there will be many points , too high will lead to just a few points)
doNotPlaypass true if you want to avoid that sequence is played right after command is executed

◆ ~CommandAreaAnalysis()

conscience_core::bridging::commands::CommandAreaAnalysis::~CommandAreaAnalysis ( )
override

Member Function Documentation

◆ doExecute()

const CscCommandExecutionResultSequence * conscience_core::bridging::commands::CommandAreaAnalysis::doExecute ( CscEnvironmentSimulator environmentSimulator)
overrideprotectedvirtual

◆ getEntityReflexion()

ptr<CscEntityReflexion> conscience_core::bridging::commands::CommandAreaAnalysis::getEntityReflexion ( ) const
inlineoverrideprotectedvirtual

return entity reflexion if this command applies on an entityReflexion, otherwise return nullptr

Implements conscience_core::bridging::commands::CscCommand.

Member Data Documentation

◆ COMMAND_ID

const CommandTypeId conscience_core::bridging::commands::CommandAreaAnalysis::COMMAND_ID = "AREA_ANALYSIS"
inlinestatic

◆ entityReflexion

ptr<CscEntityReflexion> conscience_core::bridging::commands::CommandAreaAnalysis::entityReflexion
protected

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