Error when using the "param-record-as-scalar" method

28 views
Skip to first unread message

Felix Weinrank

unread,
Feb 13, 2018, 5:28:07 AM2/13/18
to omn...@googlegroups.com
Hey all,

I'm recording parameter values using the "param-record-as-scalar" function and get an error with omnet 5.3p3:
<!> (omnetpp::cIntParImpl)RTXMethod: Cannot cast from type integer to double -- in module (inet::sctp::SCTP) sack.cli.sctp (id=123), during finalization


For example when recording the RTX method of SCTP:
**.sctp.RTXMethod = 4 
**.sctp.RTXMethod.param-record-as-scalar = true


This worked fine until Omnet 5.2


Greetings
Felix

Michael Kirsche

unread,
Feb 13, 2018, 8:34:47 AM2/13/18
to OMNeT++ Users
Probably the changes in the latest preview:
"Evaluation of NED expressions now uses integer arithmetic when operands are integers. Conversions that incur precision loss should now be explicit: converting a double to integer requires the int() cast; also, converting an int to double will raise an error if there is actual precision loss, and you can suppress that error by explicit double() cast. There are many smaller-scale changes related to this change -- see include/omnetpp/ChangeLog for details."

Nikos Terzenidis

unread,
Jun 15, 2018, 10:07:57 AM6/15/18
to OMNeT++ Users
This is a "bug" that I have also faced on a project that was migrated from Omnet++ 4.6
Probably only double parameters are allowed to be recorded in scalar files, but apart from that I cannot imagine how converting "4" to double incurs precision loss (and thus the error that results in not recording the param).

I think that it should be somehow "fixed" in future Omnet versions, since recording of simulation/module parameters is extremely useful during the interpretation of results. I don't believe that a simple cast from integer to double should prevent all integer parameters from being recorded in scalar files.

Attila Török

unread,
Jun 15, 2018, 10:49:02 AM6/15/18
to OMNeT++ Users
This whole "record-param-as-scalar" option was sort of a quick-and-dirty "solution" (by which I mean "ugly hack"). Given that parameters can not only be of int and double types, but strings, and others as well, they really should not be included as scalars, as those are always double. They should be a separate "result type", that can represent (almost) every parameter, no matter what its type is. We definitely plan to improve this in the future, as it is indeed essential for analysis.

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
Visit this group at https://groups.google.com/group/omnetpp.
For more options, visit https://groups.google.com/d/optout.

Nikos Terzenidis

unread,
Jun 18, 2018, 12:54:59 PM6/18/18
to OMNeT++ Users
Ok thanks for the feedback Attila!
Reply all
Reply to author
Forward
0 new messages