Commit 7ce91141 authored by Andreas Bayha's avatar Andreas Bayha
Browse files

Merge branch '4171' into 'master'

4171: Assume infinite runtime for tasks where no WCET as been specified

Closes #4171

See merge request !73
parents 4d6788c0 486825f1
BasicDeploScheduleConstraint.java c278ce01fdf33ac04de345040261893686237845 GREEN
BasicDeploScheduleConstraint.java c8be7b32646549d39a444dd34e5fb6030e92aac9 GREEN
BasicDeploymentConstraint.java 06515032af8bac566160d16c14fff0d44365b0d2 GREEN
BasicScheduleConstraint.java f8f5b991f1cc90ec129ef33b5575c68e49b08a7b GREEN
ConstraintTransformationAdapter.java 8806164d71491c7d1af665990dd154f2275cad8c GREEN
......
......@@ -650,9 +650,15 @@ public class BasicDeploScheduleConstraint {
// (wcet(task,ecu,freq))
ArithmeticPropertyLiteral<ResourceAllocation, Number> duration =
createDurationLiteral(ra);
BigDecimal value = getWcet(taskWcetTable, (Task)modelElement, ecu, frequency);
ArithmeticLiteral valueLiteral = createArithmeticLiteral(value);
Equal conclusion = createEquals(duration, valueLiteral);
BigDecimal wcet = getWcet(taskWcetTable, (Task)modelElement, ecu, frequency);
if(wcet == null) {
// If neither a ECU-specific WCET for task nor a generic WCET has been defined,
// prevent deployment of task to respective ECU by assuming infinite WCET
wcet = BigDecimal.valueOf(Double.MAX_VALUE);
}
ArithmeticLiteral wcetLiteral = createArithmeticLiteral(wcet);
Equal conclusion = createEquals(duration, wcetLiteral);
// create implication
Implies implication = createImplies(premise, conclusion);
......
DSEPerspectiveManager.java 22d0cc59731b420ae7ab3988119f90b302bbfc8c GREEN
DSEUIPatternExtensionService.java 69b94d4fa4e7e9c31037516f6127bc6831ca08cd GREEN
ExplorationCommandRunner.java 92aab25095869d6edcacc462b8d7b902d13a0c2a GREEN
ExplorationCommandRunner.java 2bc91a7507091767326fa509cdb4d4270a3673c6 GREEN
SaveableWrapper.java 8bfd211212e93f26ca3e76907a0249f478115ae0 GREEN
......@@ -59,7 +59,7 @@ public class ExplorationCommandRunner implements IEventListener {
/** {@inheritDoc} */
@Override
public void propertyChanged(Object source, DSE_EVENT propId) {
public synchronized void propertyChanged(Object source, DSE_EVENT propId) {
if(propId == DSE_SELECTED_EVENT && source instanceof DSE) {
ITopLevelElement topLevelElement =
IPersistencyService.getInstance().getTopLevelElementFor((DSE)source);
......@@ -73,7 +73,7 @@ public class ExplorationCommandRunner implements IEventListener {
* Executes the given runnable in the context of the currently active DSE such that a saveable
* state is achieved.
*/
public void run(Runnable runnable) {
public synchronized void run(Runnable runnable) {
modelContext.runAsCommand(runnable);
}
}
......@@ -3,5 +3,5 @@ SolverSettingsDialog.java 25b3541fc6eab090500321fa32a3f68992fff0a0 GREEN
SolverSettingsTreeTableViewer.java 0f0be7ff52d2c48fbff9d37c7e23bd7a99eb1948 GREEN
SynthesisCategoryExplorationTargetContentProvider.java 0561bf954f791f2d44b5ff7e61399251eedc4128 GREEN
SynthesisCategoryRuleSetContentProvider.java f17ea9c4b6fb4126d834e0852b766b686d3c7e42 GREEN
SynthesisFXContentController.java c798c7b9b4b920901646d79b73b31d6ba5cfe0a8 GREEN
SynthesisFXContentController.java eac585a748be2c5081f8f85f317256ed03ef2272 GREEN
SynthesisFXViewPart.java 28450a77df6d1868cf35b8f0c43b7cbc0bc93893 GREEN
......@@ -650,33 +650,28 @@ public class SynthesisFXContentController extends CompositeFXControllerBase<Anch
}
}
/**
* Predicate if there are exploration targets of the requested {@code type} that match the
* synthesis types selected by the user.
*/
private boolean hasMatchingTargets(
@SuppressWarnings("rawtypes") Class<? extends IExplorationTarget> type) {
return availTargets.stream().filter(tgt -> type.isAssignableFrom(tgt.getClass()))
.filter(tgt -> selectedSynthesises.containsAll(tgt.getSynthesisCategories()))
.findFirst().isPresent();
}
/**
* Enables/Disables buttons for {@link RuleSet} modifications based on the presence of
* {@link IExplorationTarget}s in the respective tables.
*/
private void enableDisableRuleSetButtons() {
Collection<IExplorationTarget<?>> availConstraints = availTargets.stream()
.filter(tgt -> IExplorationConstraint.class.isAssignableFrom(tgt.getClass()))
.filter(tgt -> selectedSynthesises.containsAll(tgt.getSynthesisCategories()))
.collect(toList());
if(availConstraints.isEmpty()) {
createConstraintRSBtn.setDisable(true);
addConstraintRSBtn.setDisable(true);
} else {
createConstraintRSBtn.setDisable(false);
addConstraintRSBtn.setDisable(false);
}
boolean hasMatchingConstraints = hasMatchingTargets(IExplorationConstraint.class);
createConstraintRSBtn.setDisable(!hasMatchingConstraints);
addConstraintRSBtn.setDisable(!hasMatchingConstraints);
Collection<IExplorationTarget<?>> availObjectives = availTargets.stream()
.filter(tgt -> IExplorationObjective.class.isAssignableFrom(tgt.getClass()))
.filter(tgt -> tgt.getSynthesisCategories().containsAll(selectedSynthesises))
.collect(toList());
if(availObjectives.isEmpty()) {
createObjectiveRSBtn.setDisable(true);
addObjectiveRSBtn.setDisable(true);
} else {
createObjectiveRSBtn.setDisable(false);
addObjectiveRSBtn.setDisable(false);
}
boolean hasMatchingObjectives = hasMatchingTargets(IExplorationObjective.class);
createObjectiveRSBtn.setDisable(!hasMatchingObjectives);
addObjectiveRSBtn.setDisable(!hasMatchingObjectives);
}
}
Supports Markdown
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