Skip to content

Commit

Permalink
- compute timeevents for tEnd
Browse files Browse the repository at this point in the history
  • Loading branch information
vwaurich authored and OpenModelica-Hudson committed Aug 17, 2016
1 parent fcc0b47 commit 974a19c
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions SimulationRuntime/cpp/Core/SimController/SimManager.cpp
Expand Up @@ -441,12 +441,19 @@ void SimManager::writeProperties()
*/
}

/**
Computes all stops for the time events before starting the simulation
@param A vector of all time event stop times.
*/
void SimManager::computeEndTimes(std::vector<std::pair<double, int> > &tStopsSub)
{
int counterTimes = 0, counterEvents = 0;
time_event_type timeEventPairs; ///< - Beinhaltet Frequenzen und Startzeit der Time-Events
int counterTimes = 0;
int counterEvents = 0;
time_event_type timeEventPairs;// <startTime, intervalLength> of the time events
_writeFinalState = true;

//calculate time event stops till stopTime
if (tStopsSub.size() == 0)
{
_timeevent_system->getTimeEvent(timeEventPairs);
Expand All @@ -463,7 +470,8 @@ void SimManager::computeEndTimes(std::vector<std::pair<double, int> > &tStopsSub
counterTimes++;
_solverTask = ISolver::SOLVERCALL(_solverTask | ISolver::RECALL);
}
while (iter->first + counterTimes * (iter->second) <= _tEnd)
//compute time event times for the whole simulation including the end time
while (iter->first + counterTimes * (iter->second) <= _tEnd+UROUND)
{
tStopsSub.push_back(std::make_pair(iter->first + counterTimes * (iter->second), counterEvents));
counterTimes++;
Expand Down

0 comments on commit 974a19c

Please sign in to comment.