object parameters in omnet++ 6

72 views
Skip to first unread message

Riccardo Lancellotti

unread,
Nov 30, 2022, 12:44:31 PM11/30/22
to omn...@googlegroups.com
Hi,
I am really excited by the object parameters introduced in version 6.
The documentation on the NED part is well written and I was able to
write out a .ned definition of a micro service chain workload
generator. The definition of a chain composed by a 2 microservices
should be something like:

volatile object chain=default([{serviceTime: exponential(1s),
nextNode: [{id: 1, weight: 1}],
abortProbability=0.05,
},{serviceTime: exponential(1s),
nextNode: [{id: -1, weight: 1}],
abortProbability=0,
}]);

No the tricky part seems to handle the C++ side. The documentation on
this part seems outdated (the manual mentions that objects are not
supported and I would use a string tokenizer, which seems dating back
to omnet 4 or 5).
Perhaps I should use something like:

cObject * chain_description=par("chain").objectValue();

But the basics of how to navigate the object structure are a bit
obscure. 
Is there an up-to-date example I can refer to? 
If the object is an array like in my case, how can I count the number
of items -- i.e., the number of micro-services? 
How can I access the fields of an array or a dictionary (e.g.
chain[0].serviceTime)?

Any help is welcome. Thanks!

--
Saluti,
Riccardo

Varga, András

unread,
Dec 3, 2022, 2:17:06 AM12/3/22
to omn...@googlegroups.com
Hello,

There are some hints elsewhere in the documentation: https://doc.omnetpp.org/omnetpp/manual/#sec:ned-ref:arrays-and-objects

Regards,
Andras

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/f667dca7e0d0a40f3d71c308cde0511cf7f08031.camel%40unimore.it.

Riccardo Lancellotti

unread,
Dec 3, 2022, 6:20:58 AM12/3/22
to omn...@googlegroups.com
Thank you Andràs for the precious hint!
I was looking at the code in inet 4.4 to figure out something, but this
is definitely better.

BTW, please let me know if I can provide some help in updating Section
4.5.4 of the manual.

On sab, 03/12/2022 at 08.16 +0100, 'Varga, András' via OMNeT++ Users
wrote:
Saluti,
Riccardo

Varga, András

unread,
Dec 5, 2022, 7:15:25 AM12/5/22
to omn...@googlegroups.com
Thank you for offering to help, I appreciate it! Actually I might ask you to review the section text for clarity once I write it :)


--
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.
Reply all
Reply to author
Forward
0 new messages