set parameters to dt 0.01
This commit is contained in:
+1
-1
@@ -21,7 +21,7 @@ const double cos_phi = cos(phi);
|
|||||||
|
|
||||||
const double delta_t = 2;
|
const double delta_t = 2;
|
||||||
|
|
||||||
const double dt = 0.001;
|
const double dt = 0.01;
|
||||||
|
|
||||||
// # Optional (forces.cpp: compute_repulsive_effects_from_pedestrians)
|
// # Optional (forces.cpp: compute_repulsive_effects_from_pedestrians)
|
||||||
// const double DISTANCE = 2.0;
|
// const double DISTANCE = 2.0;
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ int main(int argc, const char *argv[]) {
|
|||||||
int n_iter = atoi(argv[2]);
|
int n_iter = atoi(argv[2]);
|
||||||
|
|
||||||
// Logic to get/dump the simulation data
|
// Logic to get/dump the simulation data
|
||||||
const int dump_interval = 50; // dump every 5 iterations -> 20 fps (since dt = 0.01)
|
const int dump_interval = 5; // dump every 5 iterations -> 20 fps (since dt = 0.01)
|
||||||
const char *dump_path = (argc >= 4) ? argv[3] : nullptr;
|
const char *dump_path = (argc >= 4) ? argv[3] : nullptr;
|
||||||
|
|
||||||
std::vector<std::tuple<int, int, double, double, int>> samples; // t, id, x, y, color
|
std::vector<std::tuple<int, int, double, double, int>> samples; // t, id, x, y, color
|
||||||
@@ -117,11 +117,11 @@ int main(int argc, const char *argv[]) {
|
|||||||
if (p.color == WHITE && p.curr_pos.x > (BOARD_LENGTH - 1.5)) {
|
if (p.color == WHITE && p.curr_pos.x > (BOARD_LENGTH - 1.5)) {
|
||||||
// basically just keep the y position and reset the x
|
// basically just keep the y position and reset the x
|
||||||
p.curr_pos.x = 1.0;
|
p.curr_pos.x = 1.0;
|
||||||
// p.destination.y = p.curr_pos.y;
|
p.destination.y = p.curr_pos.y;
|
||||||
}
|
}
|
||||||
if (p.color == BLACK && p.curr_pos.x < 1.5) {
|
if (p.color == BLACK && p.curr_pos.x < 1.5) {
|
||||||
p.curr_pos.x = BOARD_LENGTH - 1.0;
|
p.curr_pos.x = BOARD_LENGTH - 1.0;
|
||||||
// p.destination.y = p.curr_pos.y;
|
p.destination.y = p.curr_pos.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
// # 10 flops = 5 ADDs, 2 DIVs, 1 SQRT, 2 MULTs
|
// # 10 flops = 5 ADDs, 2 DIVs, 1 SQRT, 2 MULTs
|
||||||
|
|||||||
Reference in New Issue
Block a user