Commit 50468190 authored by Simon Tenbusch's avatar Simon Tenbusch

[sequencechart]

- changed bottleneck finding buttons to look for bottlenecks on the critical path and according to overlapping coefficient
parent 17a06e54
......@@ -974,11 +974,11 @@ public class SequenceChartContributor extends EditorActionBarContributor impleme
return new SequenceChartAction("Jump to previous Bottleneck", Action.AS_PUSH_BUTTON, SequenceChartPlugin.getImageDescriptor(IMAGE_JUMP_TO_PREVIOUS_BOTTLENECK)) {
@Override
protected void doRun() {
sequenceChart.setShowEventOverlapping(true);
/*sequenceChart.setShowEventOverlapping(true);
if (sequenceChart.getEventLengthMode() != SequenceChart.EventLengthMode.NONE){
sequenceChart.setTimelineMode(SequenceChart.TimelineMode.SIMULATION_TIME);
timelineModeStatus.update();
}
}*/
sequenceChart.selectPreviousBottleneck();
}
@Override
......@@ -992,7 +992,7 @@ public class SequenceChartContributor extends EditorActionBarContributor impleme
return new SequenceChartAction("Jump to next Bottleneck", Action.AS_PUSH_BUTTON, SequenceChartPlugin.getImageDescriptor(IMAGE_JUMP_TO_NEXT_BOTTLENECK)) {
@Override
protected void doRun() {
sequenceChart.setShowEventOverlapping(true);
//sequenceChart.setShowEventOverlapping(true);
sequenceChart.selectNextBottleneck();
}
@Override
......@@ -1864,7 +1864,7 @@ public class SequenceChartContributor extends EditorActionBarContributor impleme
setHelpAvailable(false);
setTitle("Bottleneck Finder Preferences");
setMessage("Please choose the maximum number of parallel events to be identified as a bottleneck.");
setMessage("Please choose the maximum overlapping coefficient (in %) (0% = no overlapping, 100% = most overlapping).");
Composite container = new Composite((Composite)super.createDialogArea(parent), SWT.NONE);
container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
......@@ -1872,12 +1872,12 @@ public class SequenceChartContributor extends EditorActionBarContributor impleme
maximumLabel = new Label(container, SWT.NONE);
maximumLabel.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
maximumLabel.setText("Identify Bottlenecks with less or equal than: " + sequenceChart.getBottleneckThreshold() + " events.");
maximumLabel.setText("Identify Bottlenecks on critical path with overlapping coefficient less or equal to: " + (100*sequenceChart.getBottleneckThreshold()) + "%.");
maximum = new Scale(container, SWT.NONE);
maximum.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
maximum.setMinimum(1);
maximum.setMinimum(0);
maximum.setMaximum(100);
maximum.setSelection(sequenceChart.getBottleneckThreshold());
maximum.setSelection((int)(100*sequenceChart.getBottleneckThreshold()));
maximum.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
......@@ -1906,11 +1906,11 @@ public class SequenceChartContributor extends EditorActionBarContributor impleme
}
public void apply() {
sequenceChart.setBottleneckThreshold(maximum.getSelection());
sequenceChart.setBottleneckThreshold(maximum.getSelection()/100.0);
}
public void setMaximumText() {
maximumLabel.setText("Identify Bottlenecks with less or equal than: " + maximum.getSelection() + " events.");
maximumLabel.setText("Identify Bottlenecks on critical path with overlapping coefficient less or equal to: " + (100*sequenceChart.getBottleneckThreshold()) + "%.");
}
......
......@@ -20,6 +20,7 @@ import java.util.ListIterator;
import java.util.Map;
import java.util.Set;
import org.apache.batik.bridge.Viewport;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.Assert;
......@@ -226,7 +227,7 @@ public class SequenceChart
private boolean showAxesWithoutEvents = false;
private boolean showTransmissionDurations = true;
private int bottleneckThreshold = 2;
private double bottleneckThreshold = 0.5;
private AxisOrderingMode axisOrderingMode = AxisOrderingMode.MODULE_ID; // specifies the ordering mode of axes
......@@ -772,17 +773,27 @@ public class SequenceChart
*/
public void setTimelineMode(TimelineMode timelineMode) {
org.omnetpp.common.engine.BigDecimal[] leftRightSimulationTimes = null;
// boolean domainSwitch = (timelineMode==TimelineMode.REAL_TIME || getTimelineMode()==TimelineMode.REAL_TIME);
if(timelineMode==TimelineMode.REAL_TIME) {
//Trigger initialization of earliest starting times
sequenceChartFacade.isOnCriticalPath(null);
}
if (!eventLog.isEmpty())
leftRightSimulationTimes = getViewportSimulationTimeRange();
//TODO FIX this later (correct zooming behaviour on timeline domain switch)
/*if (domainSwitch && getTimelineMode() != TimelineMode.REAL_TIME) {
IEvent rightEvent = sequenceChartFacade.getLastEventNotAfterTimelineCoordinate(getTimelineCoordinateForViewportCoordinate(getViewportRight()));
IEvent leftEvent = sequenceChartFacade.getFirstEventNotBeforeTimelineCoordinate(getTimelineCoordinateForViewportCoordinate(getViewportLeft()));
leftRightSimulationTimes[0] = new org.omnetpp.common.engine.BigDecimal(leftEvent.get_earliestProcessingTime()-leftEvent.getComplexity());
leftRightSimulationTimes[1] = new org.omnetpp.common.engine.BigDecimal(rightEvent.get_earliestProcessingTime());
}*/
if (!eventLog.isEmpty()) {
leftRightSimulationTimes = getViewportSimulationTimeRange();
}
sequenceChartFacade.setTimelineMode(timelineMode.ordinal());
if (!eventLog.isEmpty())
setViewportSimulationTimeRange(leftRightSimulationTimes);
}
......@@ -5121,11 +5132,11 @@ public class SequenceChart
return eventLog.isLegacyTrace();
}
public int getBottleneckThreshold() {
public double getBottleneckThreshold() {
return bottleneckThreshold;
}
public void setBottleneckThreshold(int t) {
public void setBottleneckThreshold(double t) {
bottleneckThreshold = t;
}
......
......@@ -783,7 +783,7 @@ simtime_t SequenceChartFacade::getLargestEventDuration() {
}
IEvent* SequenceChartFacade::getPreviousBottleneck(IEvent* e, unsigned int threshold) {
IEvent* SequenceChartFacade::getPreviousBottleneck(IEvent* e, double threshold) {
IEvent* next = e->getPreviousEvent();
while (next) {
if (isBottleneck(next,threshold)) {
......@@ -794,7 +794,7 @@ IEvent* SequenceChartFacade::getPreviousBottleneck(IEvent* e, unsigned int thres
return e;
}
IEvent* SequenceChartFacade::getNextBottleneck(IEvent* e, unsigned int threshold) {
IEvent* SequenceChartFacade::getNextBottleneck(IEvent* e, double threshold) {
IEvent* next = e->getNextEvent();
while (next) {
if (isBottleneck(next,threshold)) {
......@@ -808,9 +808,12 @@ IEvent* SequenceChartFacade::getNextBottleneck(IEvent* e, unsigned int threshold
/*
* Returns whether an event not part of a set of parallel events with more than treshold elements.
*/
bool SequenceChartFacade::isBottleneck(IEvent* event, unsigned int threshold)
bool SequenceChartFacade::isBottleneck(IEvent* event, double threshold)
{
return getLargestParallelSetSize(event) <= threshold;
if (isOnCriticalPath(event)) {
return getOverlappingQuotient((ptr_t)event) <= threshold;
}
return false;
}
/*
* Returns whether event is in the largest parallel set of selected.
......
......@@ -128,12 +128,12 @@ class EVENTLOG_API SequenceChartFacade : public EventLogFacade
/*
* Returns whether an event not part of a set of parallel events with more than treshold elements.
*/
bool isBottleneck(IEvent* event, unsigned int threshold);
bool isBottleneck(IEvent* event, double threshold);
bool isParallelWithEvent(IEvent* event, IEvent* selected);
IEvent* getPreviousBottleneck(IEvent* e, unsigned int threshold);
IEvent* getNextBottleneck(IEvent* e, unsigned int threshold);
IEvent* getPreviousBottleneck(IEvent* e, double threshold);
IEvent* getNextBottleneck(IEvent* e, double threshold);
bool isOnCriticalPath(IEvent* event);
......
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