-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsimulation.h
61 lines (48 loc) · 1.59 KB
/
simulation.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Navigating with grid and place cells in cluttered environments
// Edvardsen et al. (2020). Hippocampus, 30(3), 220-232.
//
// Licensed under the EUPL-1.2-or-later.
// Copyright (c) 2019 NTNU - Norwegian University of Science and Technology.
// Author: Vegard Edvardsen (https://github.com/evegard).
#ifndef SIMULATION_H_INCLUDED
#define SIMULATION_H_INCLUDED
#include "agent.h"
#include "arena.h"
#include "graph.h"
#include "main.h"
#include "mec.h"
#include "numerical.h"
#include <vector>
#include <map>
#include <string>
class Simulation
{
friend class SimulationPlot;
friend class SimulationArenaComponentPlot;
public:
Simulation(Agent *agent, struct SimulationConf conf);
int run();
protected:
// Parameters given to the constructor
Agent *agent;
struct SimulationConf conf;
// Function called on each timestep to update model and simulation
bool step();
// Main simulation values. All of these are initialized in run()
int global_timestep;
double x, y, heading, speed;
// For the new version of the simulator
Arena *arena;
int reward_id;
double goto_x, goto_y;
std::map<std::string, int> reward_ids;
std::istream *script = nullptr;
int get_reward_id(std::string reward_name);
std::string current_trial_phase;
double path_length_in_current_trial_phase = 0.0;
void report_path_length_at_end_of_trial_phase();
std::map<std::string, Arena *> fences;
// Plotting
class SimulationPlot *plot = nullptr;
};
#endif