Skip to content

Commit

Permalink
Merge pull request #13 from seldon-code/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
MSallermann authored Oct 18, 2023
2 parents e91a86b + 279265f commit 8b88e0c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/agent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Agent : public AgentBase

std::string to_string() const override
{
return fmt::format( "{}", data );
return fmt::format( "{:.16f}", data );
}
};

Expand Down
4 changes: 2 additions & 2 deletions include/util/io.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() );
Expand All @@ -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<size_t>();
auto buffer_weights = std::vector<Network::WeightT>();

Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ int main( int argc, char * argv[] )
std::optional<std::string> agent_file = program.present<std::string>( "-a" );
std::optional<std::string> network_file = program.present<std::string>( "-n" );
std::optional<std::string> output_dir_path_cli = program.present<std::string>( "-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() );
Expand Down

0 comments on commit 8b88e0c

Please sign in to comment.