-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cc
More file actions
39 lines (32 loc) · 833 Bytes
/
Copy pathmain.cc
File metadata and controls
39 lines (32 loc) · 833 Bytes
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
//
// Created by santor on 20/12/17.
//
#include <iostream>
#include <thread>
#include "environment.h"
#include "agent.h"
int main()
{
unsigned int steps = 500;
unsigned int dimension = 35;
unsigned int stepTime = 100;
// cria o ambiente
EnvInit(dimension);
// adiciona os agentes
for (int i = 0; i < Env()->countElements(); ++i) {
Env()->addAgent(i);
}
// executa passos
for (int j = 0; j < steps; ++j) {
// atualiza os agentes
std::cout << "\033c"; //clear screen
std::cout << "Step: " << (j + 1) << std::endl;
for (const auto &agent : Env()->agents()) {
agent->update();
}
Env()->show();
std::cout << std::endl;
std::this_thread::sleep_for(std::chrono::milliseconds(stepTime));
}
return 0;
}