10 #include <Atoms/LayoutGenerators/LayoutGenerator.h>
23 virtual std::vector<AgentInitData>
generate(
double time)
35 inline void setCache(
const std::string& cachePath,
const std::string& cacheName)
37 m_cachePath = cachePath;
38 m_cacheName = cacheName;
41 inline void setNewAgents(
const std::vector<int>& newAgents) { m_newAgents = newAgents; }
43 void setAgentsFilter(
const std::vector<int>& newAgents);
45 inline void setCacheFrame(
double value) { m_cacheFrame = value; };
47 inline void setStartFrame(
double value) { m_startFrame = value; };
49 inline void setAgentsTimes(std::unordered_map<int, double>* value) { m_agentsTime = value; };
51 inline size_t getAgentCacheId(
size_t id) {
return m_agentIds[id]; };
53 inline void addAgentCacheId(
size_t id,
size_t value) { m_agentIds[id] = value; };
55 void setExtraAgents(
const std::unordered_map<size_t, size_t>& extraAgents);
57 void setTimeOffsetInPlace(
const bool value,
const std::unordered_map<int, bool> &overrides) { m_timeOffsetInPlace = value; m_timeOffsetInPlaces = overrides; }
59 inline const char*
typeName()
override {
return "cacheReader"; };
65 std::vector<int> m_newAgents;
67 std::unordered_map<int, bool> m_agentsFilter;
69 bool m_timeOffsetInPlace;
71 std::unordered_map<int, bool> m_timeOffsetInPlaces;
73 std::unordered_map<int, double>* m_agentsTime;
75 std::unordered_map<size_t, size_t> m_agentIds;
77 std::unordered_map<size_t, size_t> m_extraAgents;
79 std::string m_cachePath;
81 std::string m_cacheName;
87 std::set<int> m_agentsCreated;
Definition: CacheLayoutGenerator.h:16
bool allowMultiLayoutGenerator() override
Returns whether this layout generator can work in conjunction with other layout generators.
Definition: CacheLayoutGenerator.h:29
const char * typeName() override
Get the type name for this generator.
Definition: CacheLayoutGenerator.h:59
virtual std::vector< AgentInitData > generate(double time)
Generate a vector of agent init data.
Layout generator.
Definition: LayoutGenerator.h:31
AtomsMath::Matrix Matrix
Matrix class.
Definition: AtomsMath.h:63
Atoms namespace.
Definition: Agent.h:29