Skip to content
Snippets Groups Projects
Commit b64b0b9e authored by Timo Koch's avatar Timo Koch
Browse files

[timeloop] Adjust timeStepSize on setMaxTimeStepSize

parent d9287728
No related branches found
No related tags found
1 merge request!1160Fix/checkpoint timeloop
...@@ -221,7 +221,11 @@ public: ...@@ -221,7 +221,11 @@ public:
* \param maxDt The new value for the maximum time step size \f$\mathrm{[s]}\f$ * \param maxDt The new value for the maximum time step size \f$\mathrm{[s]}\f$
*/ */
void setMaxTimeStepSize(Scalar maxDt) void setMaxTimeStepSize(Scalar maxDt)
{ maxTimeStepSize_ = maxDt; } {
using std::min;
maxTimeStepSize_ = maxDt;
timeStepSize_ = min(timeStepSize_, maxDt);
}
/*! /*!
* \brief Returns the suggested time step length \f$\mathrm{[s]}\f$ so that we * \brief Returns the suggested time step length \f$\mathrm{[s]}\f$ so that we
...@@ -333,7 +337,6 @@ public: ...@@ -333,7 +337,6 @@ public:
private: private:
//! Computes the maximum timestep size respecting end time //! Computes the maximum timestep size respecting end time
//! and possibly episodes (TODO)
void computeMaxTimeStepSize_() void computeMaxTimeStepSize_()
{ {
if (finished()) if (finished())
...@@ -345,7 +348,6 @@ private: ...@@ -345,7 +348,6 @@ private:
using std::max; using std::max;
using std::min; using std::min;
// TODO check for episodes if there is an episode manager
maxTimeStepSize_ = min(maxTimeStepSize_, max<Scalar>(0.0, endTime_ - time_)); maxTimeStepSize_ = min(maxTimeStepSize_, max<Scalar>(0.0, endTime_ - time_));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment