@@ -22,7 +22,6 @@ using flamegpu::ALIVE;
2222using flamegpu::EnvironmentDescription;
2323
2424CUDASimulation *global_sim = nullptr ;
25- const char *global_out_dir = " output/" ;
2625
2726FLAMEGPU_AGENT_FUNCTION (calculate_priority, MessageNone, MessageNone) {
2827 float current_nectar = FLAMEGPU ->getVariable <float >(" current_cell_score" );
@@ -136,7 +135,7 @@ FLAMEGPU_STEP_FUNCTION(stepLogger) {
136135
137136 // Export data per step using global pointer
138137 if (global_sim) {
139- global_sim->exportData (global_out_dir + " step_" + std::to_string (step) + " .xml" );
138+ global_sim->exportData (" output/ step_" + std::to_string (step) + " .xml" );
140139 }
141140}
142141
@@ -203,11 +202,7 @@ void define_model(ModelDescription &model) {
203202}
204203
205204int main (int argc, const char ** argv) {
206- // Determine output directory based on execution context
207- if (std::filesystem::exists (" examples/cpp/beesandflowers" )) {
208- global_out_dir = " examples/cpp/beesandflowers/output/" ;
209- }
210- std::filesystem::create_directories (global_out_dir);
205+ std::filesystem::create_directories (" output/" );
211206
212207 ModelDescription model (" OneAgentMovingModel" );
213208
@@ -232,13 +227,13 @@ int main(int argc, const char ** argv) {
232227 simulation.initialise (argc, argv);
233228
234229 // Export initial state
235- simulation.exportData (global_out_dir + " initial_state.xml" );
230+ simulation.exportData (" output/ initial_state.xml" );
236231
237232 // Run the simulation normally
238233 simulation.simulate ();
239234
240235 // Export the summary log
241- simulation.exportLog (global_out_dir + " simulation_log.json" , true , true , false , false );
236+ simulation.exportLog (" output/ simulation_log.json" , true , true , false , false );
242237
243238 return EXIT_SUCCESS ;
244239}
0 commit comments