Atoms Crowd  7.0.0
CacheReaderModule.h
1 #pragma once
2 // ===========================================================================
3 // Copyright (c) 2015 Toolchefs Ltd. All rights reserved.
4 //
5 // Use of this software is subject to the terms of the Toolchefs license
6 // agreement provided at the time of installation or download, or which
7 // otherwise accompanies this software in either electronic or hard copy form.
8 // ===========================================================================
9 
10 #include <Atoms/BehaviourModule.h>
11 #include <unordered_map>
12 
13 namespace AtomsModules
14 {
16  {
17  public:
18 
20 
21  virtual ~CacheReaderModule();
22 
23  void initSimulation(Atoms::AgentGroup* agentGroup = nullptr);
24 
25  void preFrame(Atoms::AgentGroup* agentGroup = nullptr);
26 
27  void agentsCreated(const std::vector<Atoms::Agent*>& agents, Atoms::AgentGroup* agentGroup = nullptr);
28 
29  void initFrame(const std::vector<Atoms::Agent*>& agents, Atoms::AgentGroup* agentGroup = nullptr);
30 
31  static Atoms::BehaviourModule* creator(const std::string& parameter);
32 
33  private:
34 
35  double m_prevInFrame;
36 
37  double m_prevOutFrame;
38 
39  double m_prevTimeOffset;
40 
41  std::unordered_map<int, double> m_prevInAgentFrame;
42 
43  std::unordered_map<int, double> m_prevOutAgentFrame;
44 
45  std::unordered_map<int, double> m_prevAgentFrameOffset;
46 
47  std::unordered_map<int, bool> m_filterAgents;
48 
49  std::unordered_map<size_t, size_t> m_extraAgents;
50 
51  std::vector<unsigned int> m_killIds;
52 
53  int m_frameGenerated;
54 
55  std::string m_cachePath;
56 
57  std::string m_cacheName;
58 
59  int m_startFrame;
60 
61  int m_endFrame;
62  };
63 }
Agent group.
Definition: AgentGroup.h:36
Behaviour module.
Definition: BehaviourModule.h:32
Definition: CacheReaderModule.h:16
void initSimulation(Atoms::AgentGroup *agentGroup=nullptr)
Init simulation.
void initFrame(const std::vector< Atoms::Agent * > &agents, Atoms::AgentGroup *agentGroup=nullptr)
Init frame.
void agentsCreated(const std::vector< Atoms::Agent * > &agents, Atoms::AgentGroup *agentGroup=nullptr)
Agents Created.
void preFrame(Atoms::AgentGroup *agentGroup=nullptr)
Pre frame.