Serialization of PMF failes if PMF is based on IProbabilityMassFunction

Description

When running the analytical solver (SRES) on the media store example, the solving process stops with the following error:

This exception seems to be new with the integration of the latest StoEx parser/serializer. The issue appears because the Xtext-based serializer cannot serialize a probability mass function (PMF) with the generic samples SampleImpl<T>. The serializer must know the particular type of the sample (e.g. IntSampleImpl) in order to predict the type of the PMF to be serialized. The previously used serializer does not seem to have required a particular sample type.

Environment

  • Latest nightly update site /product

  • Analytical solver (SRES)

    • MediaStore example from SVN

    • Assembly: ms_base.allocation

    • Usage: ms_audio_wm_usage_realistic_3.usagemodel

Activity

Show:
Stephan Seifermann
February 1, 2021, 9:34 AM

Fix has been integrated into master.

Stephan Seifermann
January 29, 2021, 3:59 PM

We opted for a possible fix before the serialization of the expression in the solver. Introducing type safety in the probability function implementation is nearly impossible because of the sheer amount of code to be adjusted.

Frederik Reiche
January 29, 2021, 1:51 PM
Edited

Error still replicable with the appended edu.kit.kastel.scbs.ageofmaturity model

Stephan Seifermann
January 27, 2021, 6:47 PM

We (thanks to ) identified the location that produces generic samples for PMFs and inserted logic to produce the most concrete subtype of samples based on the value type. This is some sort of hacky solution because it would be better to remember the type of samples in the IProbabilityMassFunction and recreate these particular types later. However, this requires changes of APIs that are used in various places.

We are not sure if this is the only location which produces these generic samples but at least it fixes the particular error reported in the issue.

Fixed

Assignee

Stephan Seifermann

Reporter

Stephan Seifermann

Labels

None

Requirement Category

None

External issue URL

None

Severity

None

Priority

None

Status Whiteboard

None

External issue ID

None

Components

Fix versions

Affects versions

Priority

Major