forked from rsreds/git-good-daisyworld
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
26 lines (24 loc) · 727 Bytes
/
Copy pathmain.cpp
File metadata and controls
26 lines (24 loc) · 727 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
#include "world.hpp"
#include <chrono>
#include <iostream>
#include <thread>
int main() {
int size{20};
double start_black_percentage{0.2};
double start_white_percentage{0.2};
int max_age{25};
World world(size, start_black_percentage, start_white_percentage, max_age);
std::cout << "Initial global temperature: " << world.global_temperature()
<< '\n';
int it{0};
int num_iterations{100};
while (it++ < num_iterations) {
std::cout << "\033c";
world.step(1.);
std::cout << "Global temperature after " << it
<< " time step(s): " << world.global_temperature() << '\n';
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
std::cout << '\n';
return 0;
}