diff --git a/include/agent.hpp b/include/agent.hpp index 9ab0fd1..92613ac 100644 --- a/include/agent.hpp +++ b/include/agent.hpp @@ -20,7 +20,7 @@ class Agent : public AgentBase std::string to_string() const override { - return fmt::format( "{}", data ); + return fmt::format( "{:.16f}", data ); } }; diff --git a/include/util/io.hpp b/include/util/io.hpp index 6b02d91..c19cc4c 100644 --- a/include/util/io.hpp +++ b/include/util/io.hpp @@ -47,7 +47,7 @@ inline void opinions_to_file( Simulation & simulation, const std::string & file_ auto & model = simulation.model; size_t n_agents = network->n_agents(); - fmt::print( fs, "# idx_agent opinion[...]\n" ); + fmt::print( fs, "# idx_agent, opinion[...]\n" ); for( size_t idx_agent = 0; idx_agent < n_agents; idx_agent++ ) { std::string row = fmt::format( "{:>5}, {:>25}\n", idx_agent, model->get_agent( idx_agent )->to_string() ); @@ -64,7 +64,7 @@ inline void network_to_file( Simulation & simulation, const std::string & file_p auto & network = *simulation.network; size_t n_agents = network.n_agents(); - fmt::print( fs, "# idx_agent n_neighbours_in indices_neighbours_in[...] weights_in[...]\n" ); + fmt::print( fs, "# idx_agent, n_neighbours_in, indices_neighbours_in[...], weights_in[...]\n" ); auto buffer_neighbours = std::vector(); auto buffer_weights = std::vector(); diff --git a/src/main.cpp b/src/main.cpp index ee4be9d..71483c1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -33,7 +33,7 @@ int main( int argc, char * argv[] ) std::optional agent_file = program.present( "-a" ); std::optional network_file = program.present( "-n" ); std::optional output_dir_path_cli = program.present( "-o" ); - fs::path output_dir_path = output_dir_path_cli.value_or( config_file_path.parent_path() / fs::path( "output" ) ); + fs::path output_dir_path = output_dir_path_cli.value_or( fs::path( "./output" ) ); fmt::print( "Using input file: {}\n", config_file_path.string() ); fmt::print( "Output directory path set to: {}\n", output_dir_path.string() );