Class HostAPI

Nested Relationships

Nested Types

Class Documentation

class HostAPI

A flame gpu api class for use by host functions only This class should only be used by init/step/exit/exitcondition functions.

Public Types

typedef std::vector<NewAgentStorage> AgentDataBuffer
typedef std::unordered_map<std::string, AgentDataBuffer> AgentDataBufferStateMap
typedef std::unordered_map<std::string, VarOffsetStruct> AgentOffsetMap
typedef std::unordered_map<std::string, AgentDataBufferStateMap> AgentDataMap

Public Functions

explicit HostAPI(CUDASimulation &_agentModel, RandomManager &rng, CUDAScatter &scatter, const AgentOffsetMap &agentOffsets, AgentDataMap &agentData, const unsigned int &streamId, cudaStream_t stream)

Initailises pointers to 0 Stores reference of CUDASimulation

~HostAPI()

Frees held device memory

HostAgentAPI agent(const std::string &agent_name, const std::string &stateName = ModelData::DEFAULT_STATE)

Returns methods that work on all agents of a certain type currently in a given state

unsigned int getStepCounter() const

Access the current stepCount

Access the current stepCount Sepearate implementation to avoid dependency loop with cuda agent model.

Returns

the current step count, 0 indexed unsigned.

Returns

the current step count, 0 indexed unsigned.

Public Members

const HostRandom random

Host API access to seeded random number generation

const HostEnvironment environment

Host API access to environmental properties