Generated reference › API — ICoreSDK/ICoreSimulation
kind: generated#api#icoresdk-icoresimulation

API — ICoreSDK/ICoreSimulation

The public contract of 7 header(s) under src/ICoreSDK/ICoreSimulation — 7 class/struct definition(s), 88 declaration(s). Each section shows the header's banner and its public (and protected-virtual) surface exactly as the file writes it.

ICoreModelBuild.h#

src/ICoreSDK/ICoreSimulation/ICoreModelBuild.h

ICoreModelBuild#

ICoreModelBuild.h:11 · class · 6 declaration(s)

class ICoreModelBuild {
public:
    static bool buildModel(const ICoreSubsystemTreeNode* topLevelTreeNode = ICoreSubsystemTreeNodeRegistry::getHomeTreeNode());
    // static void overwriteSignal(const std::string &key, const ICoreMatrix* value);
    static std::vector<ICoreBlock*>& getOrderedBlocks();
    static std::vector<double> getAllSamplingRates_unordered();
    // static std::pair<double, double> getTwoSmallestSamplings();
    // static std::unordered_map<std::string, ICoreMatrix*>& getSignalMap();

    static void printOrderedBlocks();

    // Code export requires a single-rate subtree: verifies every (already-built) ordered
    // block/subsystem shares the source subsystem's sampling time. Logs each offender and
    // returns false on any mismatch. Call after buildModel(sourceTreeNode), before parsing.
    static bool verifyUniformSamplingTime(const ICoreSubsystemTreeNode* sourceTreeNode);

    static bool assignSolverOrders(const ICoreSubsystemTreeNode *treeNode, const bool& enumerateCommentedOutBlocks = false);
};
};

ICoreModelConfigurator.h#

src/ICoreSDK/ICoreSimulation/ICoreModelConfigurator.h

ICoreModelConfigurator#

ICoreModelConfigurator.h:4 · class · 56 declaration(s)

class ICoreModelConfigurator {
public:
    // ================== Simulation Time
    static void setStartTime(const double& newStartTime);
    static double getStartTime();
    static void setStopTime(const double& newStopTime);
    static double getStopTime();
    static void setInfiniteSimulation(const bool& newIsInfinite);
    static bool getIsInfiniteSimulation();
    static void setMaximumConsecutiveTimeBuffer(const double& newBufferTime);
    static double getMaximumConsecutiveTimeBuffer();
    static void setSlowPaceStepDelay(const double& newSamplingTime);
    static std::chrono::milliseconds getSlowPaceStepDelay();

    // ================== Solver Type
    static void setSolverType(const std::string& newSolverType);
    static std::string getSolverType();
    static std::vector<std::string> getAvailableSolverTypes();
    static bool getIsContinuousSolverType();

    static bool getIsDiscreteSolverType();

    static void setSteppingType(const std::string& newSteppingType);
    static std::string getSteppingType();
    static std::vector<std::string> getAvailableSteppingTypes();
    static bool getIsFixedTimeStep();
    static void setDiscretizationMethod(const std::string &newMethod);
    static std::string getDiscretizationMethod();
    static bool isDiscretizationMethod_ZOH();
    static bool isDiscretizationMethod_FOH();
    static bool isDiscretizationMethod_Impulse();
    static bool isDiscretizationMethod_Tustin();
    static bool isDiscretizationMethod_Matched();
    static bool isDiscretizationMethod_BackwardEuler();
    static bool isDiscretizationMethod_ForwardEuler();
    static std::vector<std::string> getAvailableDiscretizationMethods();

    // ================== Solver Type Getters
    static bool isSolverType_RK1();
    static bool isSolverType_RK2();
    static bool isSolverType_RK3();
    static bool isSolverType_RK4();
    static bool isSolverType_RK45();
    static bool isSolverType_RK23();

    // ================== Continuous time Configuration
    static void setMultiRateTolerance(const double& newMultiRateTolerance);
    static double getMultiRateTolerance();

    // ================== Fixed Stepping Configuration
    static void setGlobalSamplingTime(const double& newSamplingTime);
    static double getGlobalSamplingTime();

    // ================== Variable Stepping Configuration
    static void setMaxTimeStep(const double& newMaxTimeStep);
    static double getMaxTimeStep();
    static void setMinTimeStep(const double& newMinTimeStep);
    static double getMinTimeStep();
    static void setInitialTimeStep(const double& newInitialTimeStep);
    static double getInitialTimeStep();
    static void setRelativeTolerance(const double& newRelativeTolerance);
    static double getRelativeTolerance();
    static void setAbsoluteTolerance(const double& newAbsoluteTolerance);
    static double getAbsoluteTolerance();

    // ================== Time budget validation
    static void setTimeBudgetValidationEnabled(const bool& newTimeBudgetValidationEnabled);
    static bool isTimeBudgetValidationEnabled();
    static void setTimeBudgetRelativeTolerance(const double& newTimeBudgetRelativeTolerance);
    static double getTimeBudgetRelativeTolerance();
    static void setTimeBudgetAbsoluteTolerance(const double& newTimeBudgetAbsoluteTolerance);
    static double getTimeBudgetAbsoluteTolerance();

    // Puts every setting back to the value it has at startup. Called when a
    // project is opened that carries no solver.ini of its own, so a new or
    // pre-sidecar project starts from the documented defaults instead of
    // silently inheriting whatever the previously open project was configured
    // with. Goes through the setters, so the config panel refreshes with it.
    static void resetToDefaults();

    // ================== Constants
    static const std::string SOLVER_CONTINUOUS;
    static const std::string SOLVER_DISCRETE;

    static const std::string SOLVER_TYPE_RK1;
    static const std::string SOLVER_TYPE_RK2;
    static const std::string SOLVER_TYPE_RK3;
    static const std::string SOLVER_TYPE_RK4;
    static const std::string SOLVER_TYPE_RK45;
    static const std::string SOLVER_TYPE_RK23;

    static const std::string DISCRETE_METHOD_ZOH;
    static const std::string DISCRETE_METHOD_FOH;
    static const std::string DISCRETE_METHOD_Impulse;
    static const std::string DISCRETE_METHOD_Tustin;
    static const std::string DISCRETE_METHOD_Matched;
    static const std::string DISCRETE_METHOD_BackwardEuler;
    static const std::string DISCRETE_METHOD_ForwardEuler;
};
};

ICoreModelSimulatorAPIs.h#

src/ICoreSDK/ICoreSimulation/ICoreModelSimulatorAPIs.h

False when the build did not complete. Callers driving it from the UI are expected to say so -- the diagnosis log alone leaves a failed build looking like a successful one.

ICoreModelSimulatorAPIs#

ICoreModelSimulatorAPIs.h:5 · class · 6 declaration(s)

class ICoreModelSimulatorAPIs {
public:
    // False when the build did not complete. Callers driving it from the UI are expected to
    // say so -- the diagnosis log alone leaves a failed build looking like a successful one.
    static bool buildProject();

    static void runProjectSimulator();

    static void runProjectSimulatorInDebugMode();

    static void stopProjectSimulator();

    static void pauseProjectSimulator();

    static void stepProjectSimulator();
};
};

ICoreModelSimulator.h#

src/ICoreSDK/ICoreSimulation/Core/ICoreModelSimulator.h

Each entry pairs a port with the per-step value to force onto its signal at the start of every solve (used to inject verification test inputs).

ICoreModelSimulator#

ICoreModelSimulator.h:12 · class · 14 declaration(s)

class ICoreModelSimulator {
public:
    static void runProjectSimulator();
    static void runProjectInDebugMode();

    static ICoreMatrix runSynchronousAndCollect(
        const ICoreSubsystemTreeNode* sourceTreeNode,
        const std::vector<ICorePort*>& portsToCollect);

    // Each entry pairs a port with the per-step value to force onto its signal
    // at the start of every solve (used to inject verification test inputs).
    using InputInjectionSchedule = std::vector<std::pair<ICorePort*, std::vector<ICoreMatrix>>>;

    static ICoreMatrix runSynchronousAndCollect(
        const ICoreSubsystemTreeNode* sourceTreeNode,
        const std::vector<ICorePort*>& portsToCollect,
        const InputInjectionSchedule& inputInjection,
        double injectionSampleTimeSeconds);

    static void preStartLogic();
    static void coreLogic();
    static void postEndLogic();

    static void stopProjectSimulator();

    // Stop the solver if it is running, and JOIN the worker thread.
    //
    // stopProjectSimulator() is the timeline command -- it means "the user
    // pressed stop". This is the LIFETIME command: after it returns, no solver
    // thread exists. Safe to call when nothing is running, safe to call twice,
    // and a no-op called from the worker thread itself.
    //
    // A backstop in ICoreModelSimulator.cpp calls this at static destruction,
    // so an application that simply exits cannot leave the thread joinable --
    // which used to abort the process. See the comment on that backstop.
    static void shutdownWorkerThread();

    static void pauseSimulation();
    static void resumeSimulation();
    static void stepSimulation();

    static void registerCandidatesNextVariableStepSize(const double& dt_candidate);

    static double getCurrentTime();
    static double getProgressPercentage();

    static bool isSolvingInitialStep();
};
};

ICoreRungeKuttaEstimation.h#

src/ICoreSDK/ICoreSimulation/Core/ICoreRungeKuttaEstimation.h

ICoreRungeKuttaEstimation#

ICoreRungeKuttaEstimation.h:8 · class · 0 declaration(s)

class ICoreRungeKuttaEstimation {
public:
    static ICoreMatrix computeStateEvolution(ICoreBlockSolverEnvironment *block, const ICoreMatrix& xn_1,
                                                const double& tn_1, const double& tn, const double& dt,
                                                const std::vector<ICoreMatrix>& un_1, const std::vector<ICoreMatrix>& un);
};
};

ICoreSimulatorRepeatableWindow.h#

src/ICoreSDK/ICoreSimulation/Objects/ICoreSimulatorRepeatableWindow.h

ICoreSimulatorRepeatableWindow#

ICoreSimulatorRepeatableWindow.h:9 · class · pImpl · 2 declaration(s)

class ICoreSimulatorRepeatableWindow {
public:
    explicit ICoreSimulatorRepeatableWindow(std::map<long long, std::vector<ICoreBlock*>>& orderedBlocksByBandWidth
                                    , long long repeatableWindowWidth);

    void fire(double windowStartTime, const double& bandWidthUnitDuration) const;

    ~ICoreSimulatorRepeatableWindow();

private:
    class Impl;                    // the two-line residue; state lives here
    std::unique_ptr<Impl> impl;
};

ICoreSimulatorRepeatableWindowSolvingList.h#

src/ICoreSDK/ICoreSimulation/Objects/ICoreSimulatorRepeatableWindowSolvingList.h

ICoreSimulatorRepeatableWindowSolvingList#

ICoreSimulatorRepeatableWindowSolvingList.h:8 · class · pImpl · 4 declaration(s)

class ICoreSimulatorRepeatableWindowSolvingList {
public:
    explicit ICoreSimulatorRepeatableWindowSolvingList(const std::vector<ICoreBlock*>& listOfBlocks);

    void fire(const double &windowStartTime, const double &bandWidthUnitDuration, long long &subStep) const;

    void increaseNumOfRepeats();

    ~ICoreSimulatorRepeatableWindowSolvingList();

private:
    class Impl;                    // the two-line residue; state lives here
    std::unique_ptr<Impl> impl;
};