Skip to content

Commit

Permalink
Some prints for the simulation runs
Browse files Browse the repository at this point in the history
  • Loading branch information
MSallermann committed Mar 7, 2024
1 parent ebe025a commit 6019543
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
*.txt

.cache/

output/
Expand Down
6 changes: 5 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,16 @@ int main( int argc, char * argv[] )
auto simulation = Seldon::Simulation( config_file_path.string(), network_file, agent_file );

// Seldon::IO::network_to_dot_file( *simulation.network, ( output_dir_path / fs::path( "network.dot" ) ).string() );

Seldon::IO::network_to_file( simulation, ( output_dir_path / fs::path( "network_0.txt" ) ).string() );
auto filename = fmt::format( "opinions_{}.txt", 0 );
Seldon::IO::opinions_to_file( simulation, ( output_dir_path / fs::path( filename ) ).string() );

const std::optional<size_t> n_output_agents = simulation.output_settings.n_output_agents;
const std::optional<size_t> n_output_network = simulation.output_settings.n_output_network;

fmt::print( "=================================================================\n" );
fmt::print( "Starting simulation\n" );

typedef std::chrono::milliseconds ms;
auto t_simulation_start = std::chrono::high_resolution_clock::now();
do
Expand Down Expand Up @@ -95,5 +97,7 @@ int main( int argc, char * argv[] )
fmt::print(
"Finished after {} iterations, total time = {:%Hh %Mm %Ss}\n", simulation.model->n_iterations,
std::chrono::floor<ms>( total_time ) );
fmt::print( "=================================================================\n" );

return 0;
}

0 comments on commit 6019543

Please sign in to comment.