src/Screens/SimulatorScreen.cpp
// draw top-level "simulation stats" tab that shows integrator stats etc. for
// the focused simulation
draw top-level "simulation stats" tab that shows integrator stats etc. for
the focused simulation
draw top - level " simulation stats " tab that shows integrator stats etc . for the focused simulation
void drawSimulationStatsTab(osc::SimulatorScreen::Impl& impl) {
        UiSimulation const* maybeFocused = impl.mes->getFocusedSim();
        if (!maybeFocused) {
            ImGui::TextDisabled("(no simulation selected)");
            return;
        }
        UiSimulation const& focused = *maybeFocused;
        ImGui::Dummy(ImVec2{0.0f, 1.0f});
        ImGui::TextUnformatted("parameters:");
        ImGui::SameLine();
        DrawHelpMarker("The parameters used when this simulation was launched. These must be set *before* running the simulation");
        ImGui::Separator();
        ImGui::Dummy(ImVec2{0.0f, 2.0f});
        {
            FdParams const& p = focused.simulation->params();
            ImGui::Columns(2);
            ImGui::TextUnformatted(p.g_FinalTimeTitle);
            ImGui::SameLine();
            DrawHelpMarker(p.g_FinalTimeDesc);
            ImGui::NextColumn();
            ImGui::Text("%f", p.FinalTime.count());
            ImGui::NextColumn();
            ImGui::TextUnformatted(p.g_ThrottleToWallTimeTitle);
            ImGui::SameLine();
            DrawHelpMarker(p.g_ThrottleToWallTimeDesc);
            ImGui::NextColumn();
            ImGui::TextUnformatted(p.ThrottleToWallTime ? "true" : "false");
            ImGui::NextColumn();
            ImGui::TextUnformatted(p.g_IntegratorMethodUsedTitle);
            ImGui::SameLine();
            DrawHelpMarker(p.g_IntegratorMethodUsedDesc);
            ImGui::NextColumn();
            ImGui::TextUnformatted(g_IntegratorMethodNames[p.IntegratorMethodUsed]);
            ImGui::NextColumn();
            ImGui::TextUnformatted(p.g_ReportingIntervalTitle);
            ImGui::SameLine();
            DrawHelpMarker(p.g_ReportingIntervalDesc);
            ImGui::NextColumn();
            ImGui::Text("%f", p.ReportingInterval.count());
            ImGui::NextColumn();
            ImGui::TextUnformatted(p.g_IntegratorStepLimitTitle);
            ImGui::SameLine();
            DrawHelpMarker(p.g_IntegratorStepLimitDesc);
            ImGui::NextColumn();
            ImGui::Text("%i", p.IntegratorStepLimit);
            ImGui::NextColumn();
            ImGui::TextUnformatted(p.g_IntegratorMinimumStepSizeTitle);
            ImGui::SameLine();
            DrawHelpMarker(p.g_IntegratorMinimumStepSizeDesc);
            ImGui::NextColumn();
            ImGui::Text("%f", p.IntegratorMinimumStepSize.count());
            ImGui::NextColumn();
            ImGui::TextUnformatted(p.g_IntegratorMaximumStepSizeTitle);
            ImGui::SameLine();
            DrawHelpMarker(p.g_IntegratorMaximumStepSizeDesc);
            ImGui::NextColumn();
            ImGui::Text("%f", p.IntegratorMaximumStepSize.count());
            ImGui::NextColumn();
            ImGui::TextUnformatted(p.g_IntegratorAccuracyTitle);
            ImGui::SameLine();
            DrawHelpMarker(p.g_IntegratorAccuracyDesc);
            ImGui::NextColumn();
            ImGui::Text("%f", p.IntegratorAccuracy);
            ImGui::NextColumn();
            ImGui::TextUnformatted(p.g_UpdateLatestStateOnEveryStepTitle);
            ImGui::SameLine();
            DrawHelpMarker(p.g_UpdateLatestStateOnEveryStepDesc);
            ImGui::NextColumn();
            ImGui::TextUnformatted(p.UpdateLatestStateOnEveryStep ? "true" : "false");
            ImGui::NextColumn();
            ImGui::Columns();
        }
        ImGui::Dummy(ImVec2{0.0f, 10.0f});
        ImGui::TextUnformatted("plots:");
        ImGui::SameLine();
        DrawHelpMarker("These plots are collected from the underlying simulation engine as the simulation runs. The data is heavily affected by the model's structure, choice of integrator, and simulation settings");
        ImGui::Separator();
        ImGui::Dummy(ImVec2{0.0f, 2.0f});
        {
            std::vector<float>& scratch = impl.plotscratch;
            int imgui_id = 0;
            ImGui::Columns(2);
            OSC_DRAW_SIMSTAT_PLOT(AccuracyInUse);
            OSC_DRAW_SIMSTAT_PLOT(NumConvergenceTestFailures);
            OSC_DRAW_SIMSTAT_PLOT(NumConvergentIterations);
            OSC_DRAW_SIMSTAT_PLOT(NumDivergentIterations);
            OSC_DRAW_SIMSTAT_PLOT(NumErrorTestFailures);
            OSC_DRAW_SIMSTAT_PLOT(NumIterations);
            OSC_DRAW_SIMSTAT_PLOT(NumProjectionFailures);
            OSC_DRAW_SIMSTAT_PLOT(NumQProjections);
            OSC_DRAW_SIMSTAT_PLOT(NumQProjectionFailures);
            OSC_DRAW_SIMSTAT_PLOT(NumRealizations);
            OSC_DRAW_SIMSTAT_PLOT(NumRealizationFailures);
            OSC_DRAW_SIMSTAT_PLOT(NumStepsAttempted);
            OSC_DRAW_SIMSTAT_PLOT(NumStepsTaken);
            OSC_DRAW_SIMSTAT_PLOT(NumUProjections);
            OSC_DRAW_SIMSTAT_PLOT(NumUProjectionFailures);
            OSC_DRAW_SIMSTAT_PLOT(PredictedNextStepSize);
            ImGui::Columns();
        }
    }
void drawSimulationStatsTab ( osc :: SimulatorScreen :: Impl & impl ) { UiSimulation const * maybeFocused = impl . mes -> getFocusedSim ( ) ; if ( ! maybeFocused ) { ImGui :: TextDisabled ( " " ) ; return ; } UiSimulation const & focused = * maybeFocused ; ImGui :: Dummy ( ImVec2 { 0.0f , 1.0f } ) ; ImGui :: TextUnformatted ( " " ) ; ImGui :: SameLine ( ) ; DrawHelpMarker ( " " ) ; ImGui :: Separator ( ) ; ImGui :: Dummy ( ImVec2 { 0.0f , 2.0f } ) ; { FdParams const & p = focused . simulation -> params ( ) ; ImGui :: Columns ( 2 ) ; ImGui :: TextUnformatted ( p . g_FinalTimeTitle ) ; ImGui :: SameLine ( ) ; DrawHelpMarker ( p . g_FinalTimeDesc ) ; ImGui :: NextColumn ( ) ; ImGui :: Text ( " " , p . FinalTime . count ( ) ) ; ImGui :: NextColumn ( ) ; ImGui :: TextUnformatted ( p . g_ThrottleToWallTimeTitle ) ; ImGui :: SameLine ( ) ; DrawHelpMarker ( p . g_ThrottleToWallTimeDesc ) ; ImGui :: NextColumn ( ) ; ImGui :: TextUnformatted ( p . ThrottleToWallTime ? " " : " " ) ; ImGui :: NextColumn ( ) ; ImGui :: TextUnformatted ( p . g_IntegratorMethodUsedTitle ) ; ImGui :: SameLine ( ) ; DrawHelpMarker ( p . g_IntegratorMethodUsedDesc ) ; ImGui :: NextColumn ( ) ; ImGui :: TextUnformatted ( g_IntegratorMethodNames [ p . IntegratorMethodUsed ] ) ; ImGui :: NextColumn ( ) ; ImGui :: TextUnformatted ( p . g_ReportingIntervalTitle ) ; ImGui :: SameLine ( ) ; DrawHelpMarker ( p . g_ReportingIntervalDesc ) ; ImGui :: NextColumn ( ) ; ImGui :: Text ( " " , p . ReportingInterval . count ( ) ) ; ImGui :: NextColumn ( ) ; ImGui :: TextUnformatted ( p . g_IntegratorStepLimitTitle ) ; ImGui :: SameLine ( ) ; DrawHelpMarker ( p . g_IntegratorStepLimitDesc ) ; ImGui :: NextColumn ( ) ; ImGui :: Text ( " " , p . IntegratorStepLimit ) ; ImGui :: NextColumn ( ) ; ImGui :: TextUnformatted ( p . g_IntegratorMinimumStepSizeTitle ) ; ImGui :: SameLine ( ) ; DrawHelpMarker ( p . g_IntegratorMinimumStepSizeDesc ) ; ImGui :: NextColumn ( ) ; ImGui :: Text ( " " , p . IntegratorMinimumStepSize . count ( ) ) ; ImGui :: NextColumn ( ) ; ImGui :: TextUnformatted ( p . g_IntegratorMaximumStepSizeTitle ) ; ImGui :: SameLine ( ) ; DrawHelpMarker ( p . g_IntegratorMaximumStepSizeDesc ) ; ImGui :: NextColumn ( ) ; ImGui :: Text ( " " , p . IntegratorMaximumStepSize . count ( ) ) ; ImGui :: NextColumn ( ) ; ImGui :: TextUnformatted ( p . g_IntegratorAccuracyTitle ) ; ImGui :: SameLine ( ) ; DrawHelpMarker ( p . g_IntegratorAccuracyDesc ) ; ImGui :: NextColumn ( ) ; ImGui :: Text ( " " , p . IntegratorAccuracy ) ; ImGui :: NextColumn ( ) ; ImGui :: TextUnformatted ( p . g_UpdateLatestStateOnEveryStepTitle ) ; ImGui :: SameLine ( ) ; DrawHelpMarker ( p . g_UpdateLatestStateOnEveryStepDesc ) ; ImGui :: NextColumn ( ) ; ImGui :: TextUnformatted ( p . UpdateLatestStateOnEveryStep ? " " : " " ) ; ImGui :: NextColumn ( ) ; ImGui :: Columns ( ) ; } ImGui :: Dummy ( ImVec2 { 0.0f , 10.0f } ) ; ImGui :: TextUnformatted ( " " ) ; ImGui :: SameLine ( ) ; DrawHelpMarker ( " " ) ; ImGui :: Separator ( ) ; ImGui :: Dummy ( ImVec2 { 0.0f , 2.0f } ) ; { std :: vector < float > & scratch = impl . plotscratch ; int imgui_id = 0 ; ImGui :: Columns ( 2 ) ; OSC_DRAW_SIMSTAT_PLOT ( AccuracyInUse ) ; OSC_DRAW_SIMSTAT_PLOT ( NumConvergenceTestFailures ) ; OSC_DRAW_SIMSTAT_PLOT ( NumConvergentIterations ) ; OSC_DRAW_SIMSTAT_PLOT ( NumDivergentIterations ) ; OSC_DRAW_SIMSTAT_PLOT ( NumErrorTestFailures ) ; OSC_DRAW_SIMSTAT_PLOT ( NumIterations ) ; OSC_DRAW_SIMSTAT_PLOT ( NumProjectionFailures ) ; OSC_DRAW_SIMSTAT_PLOT ( NumQProjections ) ; OSC_DRAW_SIMSTAT_PLOT ( NumQProjectionFailures ) ; OSC_DRAW_SIMSTAT_PLOT ( NumRealizations ) ; OSC_DRAW_SIMSTAT_PLOT ( NumRealizationFailures ) ; OSC_DRAW_SIMSTAT_PLOT ( NumStepsAttempted ) ; OSC_DRAW_SIMSTAT_PLOT ( NumStepsTaken ) ; OSC_DRAW_SIMSTAT_PLOT ( NumUProjections ) ; OSC_DRAW_SIMSTAT_PLOT ( NumUProjectionFailures ) ; OSC_DRAW_SIMSTAT_PLOT ( PredictedNextStepSize ) ; ImGui :: Columns ( ) ; } }
draw top-level "simulation stats" tab that shows integrator stats etc.
draw top - level " simulation stats " tab that shows integrator stats etc .
// draw simulation parameters // draw simulation stat plots