From f0208cbc865822057196de77054163dbade48581 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Wed, 5 May 2021 16:42:11 +0200 Subject: Create simulator --- inputs.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 inputs.cc (limited to 'inputs.cc') diff --git a/inputs.cc b/inputs.cc new file mode 100644 index 0000000..1f90ab6 --- /dev/null +++ b/inputs.cc @@ -0,0 +1,14 @@ +#include "inputs.hpp" + + + +Inputs::Inputs(std::string node_name){ + FILE* input_file = fopen(INPUTS_FILE, "rb"); + char input_file_buffer[65536]; + rapidjson::FileReadStream is(input_file, input_file_buffer, sizeof(input_file_buffer)); + d.ParseStream(is); + fclose(input_file); + + wake_duration=d[node_name.c_str()]["wake_duration"].GetDouble(); + wake_interval=d[node_name.c_str()]["wake_interval"].GetDouble(); +} \ No newline at end of file -- cgit v1.2.3