Commit 9bd9afa7 authored by Simon Tenbusch's avatar Simon Tenbusch

[sequencechart]

-started to use new ordering in some methods
parent 12288d0e
......@@ -319,13 +319,14 @@ IEvent *SequenceChartFacade::getLastEventNotAfterTimelineCoordinate(double timel
switch (timelineMode) {
case REAL_TIME:
{
//TODO MAKE THIS MORE EFFICIENT (i.e. sorted data structure)!
IEvent* res = eventLog->getFirstEvent();
for (IEvent *current = eventLog->getFirstEvent(); current; current = current->getNextEvent()) {
IEvent* res = eventLog->getFirstEventRealTime();
for (IEvent *current = eventLog->getFirstEventRealTime(); current; current = current->getNextEventRealTime()) {
if ((double) current->getEarliestStartTime() / 1000000.0 < timelineCoordinate) {
if (current->getEarliestStartTime() > res->getEarliestStartTime()) {
res = current;
}
} else {
break;
}
}
return res;
......@@ -364,13 +365,14 @@ IEvent *SequenceChartFacade::getFirstEventNotBeforeTimelineCoordinate(double tim
switch (timelineMode) {
case REAL_TIME:
{
//TODO MAKE THIS MORE EFFICIENT (i.e. sorted data structure)!
IEvent* res = eventLog->getLastEvent();
for (IEvent *current = eventLog->getFirstEvent(); current; current = current->getNextEvent()) {
IEvent* res = eventLog->getLastEventRealTime();
for (IEvent *current = eventLog->getFirstEventRealTime(); current; current = current->getNextEventRealTime()) {
if ((double) current->getEarliestStartTime() / 1000000.0 > timelineCoordinate) {
if (current->getEarliestStartTime() < res->getEarliestStartTime()) {
res = current;
}
} else {
break;
}
}
return res;
......@@ -785,23 +787,23 @@ simtime_t SequenceChartFacade::getLargestEventDuration() {
IEvent* SequenceChartFacade::getPreviousBottleneck(IEvent* e, double threshold) {
IEvent* next = e->getPreviousEvent();
IEvent* next = e->getPreviousEventRealTime();
while (next) {
if (isBottleneck(next,threshold)) {
return next;
}
next = next->getPreviousEvent();
next = next->getPreviousEventRealTime();
}
return e;
}
IEvent* SequenceChartFacade::getNextBottleneck(IEvent* e, double threshold) {
IEvent* next = e->getNextEvent();
IEvent* next = e->getNextEventRealTime();
while (next) {
if (isBottleneck(next,threshold)) {
return next;
}
next = next->getNextEvent();
next = next->getNextEventRealTime();
}
return e;
}
......@@ -1090,7 +1092,7 @@ double SequenceChartFacade::getOverlapping(ptr_t eventPtr) {
long eventProcessingTime = event->getEarliestProcessingTime();
long eventStartTime = event->getEarliestStartTime();
for (IEvent *current = eventLog->getFirstEvent(); current; current = current->getNextEvent()) {
for (IEvent *current = eventLog->getFirstEventRealTime(); current; current = current->getNextEventRealTime()) {
if(current->getComplexity() == 0) {
continue;
......@@ -1106,6 +1108,10 @@ double SequenceChartFacade::getOverlapping(ptr_t eventPtr) {
} else if (currentStartTime <= eventStartTime && currentProcessingTime >= eventProcessingTime) {
overlapping += event->getComplexity();
}
if (current->getEarliestStartTime() > eventProcessingTime) {
break;
}
}
return overlapping / (event->getComplexity() * 1.0);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment