Substitute runtimeException with a warning if no guard in a branchtransition evaluates to true

Description

In case of no guarded branch transition evaluates to true, the simulation is stopped by a RuntimeException.
In the case of a Probabilistic Branch the Probabilities are automatically normalized if they do not sum up to 1.
For guarded branches this is not possible however it might be very helpfull to continue the simulation including a Warning in the Logging instead of stopping the complete simulation run.

I already implemented this in my local version of the transformation templates.

in m2t_transforms::sim::java_core.xpt the following line have to be added starting at line 37

private static org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(de.uka.ipd.sdq.simucomframework.model.SimuComModel.class.getName());

It is not possible to use the origial class name for logger registration, as the generated package name depends on the repository's name.

In m2t_transforms::sim::seff.xpt, line 74
throw new RuntimeException("No branch condition evaluated to true :-(");

should be substituted with:
logger.warn("No branch condition evaluated to true in «this.entityName» :-(");

Environment

Operating System: All
Platform: PC

Activity

Show:
User known
December 16, 2011, 4:25 PM

I also opt against this patch (while issuing an error is a decent trade-off). However, the arguments:
1.) You cannot compare it to the normalisation feature for PDFs. This has been introduced to deal with the issue that summing up double numbers is imprecise and sometimes it failed when not normalised according to a predefined epsilon. Using it for other cases is possible but not recommended.
2.) Forcing valid models to cover every branch is necessary for the Dependency Solver. SimuCom also only checks the semantic constraint incomplete. The branches of valid models are also not allowed to overlap which is not checked.

The only correct solution would be to include these checks in the validation of the model. There we already differentiate between validation warnings and validation errors....

User known
December 15, 2011, 4:31 PM

Ok.

I guess it also should be added to the guarded branch transition metamodel documentation, as we usually say that SimuCom somewhat defines the semantics?

User known
December 15, 2011, 4:10 PM

I discussed this topic with Klaus and Micha.

The behaviour is comparable to the automated adaptation of probabilistic branches.
If they do not sum up to 1, the values are adapted automatically and an error is logged.

Additionally, I documented the changes within the change log as requested by Klaus.

I changed Warning to Error. That was a good point.
As Warnings and Errors are shown in red they are quite obvious.

User known
December 15, 2011, 3:45 PM

I am not sure whether that is a good idea. Such a model is invalid in my understanding. Such an issue is most likely caused by some forgotten aspect. Warnings by the simulation are easily overlooked, so an error is maybe more appropriate.

You are proposing to add a new implicit empty else branch. If we want to do that, that should probably also be documented for the metamodel itself.

Fixed

Assignee

Anne Koziolek

Reporter

Former user

Labels

None

Requirement Category

None

External issue URL

Severity

major

Priority

P5

Status Whiteboard

None

External issue ID

793

Components

Affects versions

Priority