forked from omnetpp/omnetpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWHATSNEW
7326 lines (5432 loc) · 329 KB
/
WHATSNEW
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
What's New
==========
This file summarizes OMNeT++ changes in each release. For changes related to
simulation model compatibility, see doc/API-Changes. For more detailed info
about all changes, see include/ChangeLog, src/*/ChangeLog, and ide/ChangeLog.
OMNeT++ 6.0.1 (September 2022)
------------------------------
This is a maintenance release containing several bugfixes.
Simulation kernel:
- Fix: Proper namespace resolution for C++ types in `@signal` declarations.
- Added `cProperty::getValueOriginFile()`, `getValueOriginType()`.
- Fix: Build errors on newer versions of clang.
- Fix #933: eventlog recording intervals were ignored.
- Fix: Check for context component in all built-in NED functions that need it
and throw an exception if there is none, instead of just crashing.
IDE:
- CDT component upgraded to 10.6.2
- Fix #938: Filtering the eventlog in the sequence chart makes it empty.
- Fix #896: NED visual editor cannot show warning symbol.
- Fix #634: NED files in search results now open properly in NED editor.
- Fix #932: Exception when the filter button was clicked on the Sequence
Chart window.
- Fix #936: Illegible text on build output console in dark mode.
Analysis Tool:
- Various fixes in the Python analysis package.
- Added the `python/` folders of referenced project(s) to Python path of chart scripts.
- On Windows, the bundled Python was upgraded to 3.10, fixing several issues
in NumPy and Matplotlib.
NED Documentation Generator:
- Refined support for msg types with namespace.
- Added support for "@debug links" page directive.
- Made namespaces appear in the navigation tree.
Qtenv:
- Fix: Non-working parameter replacements in channel display strings.
- Fix: Missing logs with disabled event/initialization banners.
- Fix #934: Eliminate assertion failure on stopping eventlog recording from Qtenv.
- Fix: Clamp nonzero computed animation speed to at least 1e-9. (Very low
animation speed could result in simulation time not progressing at all,
due to finite precision in the computations.)
- Various other minor bug fixes.
Documentation:
- Minor corrections in the Installation Guide.
- Updated documentation for the `omnetpp.scave` Python classes.
- Document fingerprint ingredients added in 6.0.
See ChangeLogs in individual folders for details.
OMNeT++ 6.0 (April 2022)
------------------------
OMNeT++ 6.0 is the result of more than three years of work, and includes many
essential new features that we would already have a hard time without. The
present changelog summarizes all changes made during the 15+ pre-releases.
We briefly summarize the changes below in each part of OMNeT++ before going into
the details.
The most prominent new feature is the new Python-based Analysis Tool in the IDE.
The use of Python under the hood allows for arbitrarily complex computations to
be performed on the data, visualizing the result in the most appropriate form
chosen from a multitude of plot types, and producing publication quality output,
all while using an intuitive user interface that makes straightforward tasks
easy and convenient. Custom computations and custom plots are also easily
accessible. The tool is able to handle large quantities of data. The Python APIs
are also available outside the IDE (e.g. for standalone scripts), and a
command-line tool for viewing and exporting charts created in the IDE also
exists (`opp_charttool`).
The NED language now supports parameters that carry C++ objects as values (type
`object`), which can be used to parameterize modules with structured data
(e.g. nontrivial configuration), packet prototypes, function objects, etc.
Structured data may come from NED functions like `readCSV()` or `readJSON()`
which parse data files, or may be specified directly in NED or ini files using
JSON syntax. The syntax of ini files has even been adjusted to make it more
convenient to write multi-line JSON values in it. Further new functionality
includes the string match operator `=~`, the "spaceship" operator `<=>`, and
support for Universal Function Call Syntax (UFCS). Incompatible changes include
the change in the interpretation of parameter names that are not qualified with
the `this` or `parent` keywords, and the necessity to mark module parameters
with `@mutable` that are allowed to be set at runtime. Embedding NED files into
simulation binaries for easier dissemination has also become possible.
Message descriptions (msg files) have undergone even bigger changes. An import
system has been added to make the content of a msg file available in others. The
generated code and class descriptors can now be widely customized via
properties. Targeted C++ blocks have been introduced for injecting C++ code into
various places in the generated source files. Altogether, these (and further,
smaller) features facilitate writing significantly cleaner msg files, especially
in large projects like INET.
The format of ini files have been made more flexible: the `Config` word in
section headers is now optional, and long lines can be broken up to multiple
lines without using trailing backslashes (just indent the continuation lines).
In the simulation kernel, the most important change is the introduction of the
Transmission Updates API, which allows in-progress packet (frame) transmissions
to be modified, i.e. aborted, shortened, or extended. This API is necessary for
implementing L2 features like frame preemption or on-the-fly frame aggregation.
Other changes include the addition of utility APIs like `scheduleAfter()`,
`rescheduleAt()` and `rescheduleAfter()`, refinements around module deletion and
the introduction of the `preDelete()` virtual member function, refinements in
the signals and listeners APIs, improved expression evaluation support, and the
addition of string-handling utility functions, just to name a few.
Regarding statistics recording, perhaps the most significant addition is the
`demux` filter, which allows splitting a single stream (of emitted values) to
multiple streams. The filter makes it possible to record statistics subdivided
by some criteria, e.g. to record statistics per TCP connection, per remote IP
address, per traffic class, etc., in INET. Further improvements include the
addition of the `warmup` filter and the `autoWarmupFilter` statistic attribute
that allow computed statistics to be calculated correctly also in the presence
of a nonzero warm-up period. Result files now hold more metadata: parameter
values and configuration entries are now also (optionally) recorded. This
change, together with other, smaller adjustments, cause new result files not be
understood by previous versions of OMNeT++.
A significant amount of work has been put into improving the looks and
functionality of Qtenv: material-style icons, HIDPI support, dark theme support,
and countless small features that improve usability, especially around the
Object Inspector and the Log View. For example, it is now possible to set the
Messages view of the Log to display all timestamps as a delta to a
user-specified reference timestamp; or, the Object Inspector now allows
selecting a different display mode for a tree node. One important change is
that method call animations are now disabled by default.
The Sequence Chart tool in the IDE has been significantly improved, both
visually and functionally, with the goal of allowing the user to configure the
chart in a way that facilitates understanding of the sequence of events in the
simulation. The tools provided for that purpose are the possibility to hide
unnecessary elements (unrelated arrows, events, etc), support for user-defined
coloring, interactively collapsible compound module axes, horizontally expanded
events so that the arrows of nested method calls do not overlap, and more. The
eventlog file format has also changed in a non-backward-compatible way, due to
the addition of extra elements that allow the Sequence Chart tool to be faster
and more scalable.
Generating documentation from NED and MSG files has been made possible from the
command line as well, using the new `opp_neddoc` tool. Functionality has been
extended with the possibility of incorporating external information into the
generated pages.
The C++ debugging experience has been made more pleasant in several ways. For
example, the "Debug on Error" and "Debug Next Event" functionality in Qtenv may
now invoke the integrated debugger of the Simulation IDE, which is especially
useful when the simulation was launched from the IDE. The User Guide also
contains a hint on how to configure simulations to invoke VS Code as debugger.
Due to improvements in the toolchain and the build process, Windows users
may see the linking time of large models like INET Framework to drop
dramatically (1-2 orders magnitude, e.g. from several minutes to several
seconds). On macOS, Apple Silicon, is currently supported with x86-64 emulation.
Now, the details:
NED:
- Semantics change: Within a submodule's or connection's curly brace block,
the interpretation of parameter, gate, and submodule references that don't
use an explicit `parent` or `this` qualifier has changed. They no longer
refer to the enclosing compound module's item, but to the item of (or
within) the local submodule or channel object. The interpretation of item
references outside subcomponent blocks has remained unchanged. An example:
network Network {
parameters:
int foo;
submodules:
node1: { ... }
node2: Node {
foo = foo; // ERROR: self-reference! Change to 'foo=parent.foo'.
bar = this.foo; // OK
baz = node1.foo; // ERROR: refers to yet-uncreated submodule node2.node1!
bax = parent.node1.foo; // OK
}
}
The set of forms accepted by `exists()` and `sizeof()` has been expanded.
Notably, `exists()` can now be used to check the existence of an item in a
submodule vector (as submodule vectors may now contain holes, due to
`@omittedTypename`). Also, the `index()` syntax has been removed, `index`
is only accepted without parens.
Note that referencing a submodule's submodule from NED (i.e. the `a.b` or
`this.a.b` syntax within a submodule block) is generally wrong, because the
network is built top-down, and submodules are only created after parameters
have already been set up. (An exception is using it in the values of
`volatile` parameters, because they are evaluated later.)
Error messages have been revised and expanded to be more helpful and
facilitate porting NED code from 5.x.
To write NED which is compatible with both OMNeT++ version 5.x and 6.0,
qualify all references within subcomponent blocks with explicit `parent`
or `this`, and require OMNeT++ 5.7 which is the first and only 5.x version
that understands the `parent` keyword.
- NED grammar: Added `object` as parameter type. Parameters of this type may
hold objects subclassed from `cOwnedObject` that they can take ownership of.
- NED parameters of type `object` may have a `@class()` property, with
the syntax `@class(classname)` or `@class(classname?)`. The property
specifies that the parameter should only accept objects of the given type
and its subclasses. The referenced class must be registered via
`Register_Class()` or `Register_Abstract_Class()`. Parameters declared
without the question mark in `@class()` don't accept `nullptr` as value,
while the ones with question mark do.
- The NED expression syntax has been extended to accept JSON-style constructs,
i.e. arrays and dictionaries (termed "object" in JSON), and the `nullptr`
keyword. The array syntax is a list of values enclosed in square brackets,
for example `[1, 2, 3]`, and the array is accessible as a `cValueArray`
object in C++. The dictionary syntax uses curly braces:
`{"foo" : 1, "bar" : 2 }`, and dictionaries are presented as `cValueMap`
objects. If a dictionary is prefixed by a name, then the name is
interpreted as a class name, and values are interpreted as fields of the object:
`cMessage { name: "hello", kind: 1}`.
- Object parameters allow simple values (int, double, bool, string) as well.
C++-wise, they are stored in the parameter in `cValueHolder`-wrapped
`cValue` objects.
- New NED functions have been introduced: `get()` (return an element of an
array or dictionary), `size()` (returns the size of an array or dictionary),
`eval()` (evaluates a NED expression given as string), `dup()` (clones an
object). `dup()` simply calls an object's C++ `dup()` method; it is useful
because module parameters of type `object` only accept objects they fully
own, which can be worked around using `dup()`. An example:
object a = [1,2,3];
object b = dup(a); // without dup() it is an error: value is owned by parameter 'a'
As `dup()` invoked on containers only duplicates the objects owned by the
container, you may need extra `dup()` call when referring to objects owned
by other parameters. Example:
object a = {};
object b = dup([a,a]); // ERROR (a's inside the array are not cloned)
object c = [dup(a), dup(a)] // OK
- NED grammar: Made operator precedence more similar to C/C++.
Relational operators (`==, !=, <, <=, >, >=`) used to be on the same
precedence level; now `==` and `!=` have lower precedence than the rest.
- NED grammar: Added the `=~` (match) and `<=>` (comparison, a.k.a.
"spaceship") operators, the `undefined` keyword, and `bool()` as
conversion function.
- String constants are now accepted with apostrophes too. This makes it
possible to write quotation marks in strings without the need to escape
them.
- For quantities (numbers with measurement units), the rules have changed
slightly. When specifying quantities with multiple terms, a minus sign is
only accepted at the front, to reduce the chance of confusion in arithmetic
expressions. I.e. `-5s100ms` is valid as a quantity string (and means
-5.1s), but `5s-100ms` is no longer.
Also, the plain "0" constant is no longer accepted at places where a
quantity with a measurement unit is expected. Reason: it was confusing when
the expected unit was dB or dBm. E.g. in `omnetpp.ini`, should `**.power = 0`
be interpreted as 0W or 0dBm?
- Added support for Universal Function Call Syntax (UFCS) to NED, which means
that now any function call may also be written as if the function was a
method of its first argument (provided it has one). That is, `f(x,..)` can now
be also written in the alternative form `x.f(...)`. This results in improved
readability in certain cases, and allows chaining function calls.
- `xmldoc()` (and other file-reading functions) now interpret the file name as
relative to the directory the expression comes from. When `xmldoc()` occurs
in an included ini file, the file name is now interpreted as relative to the
directory containing the included ini file (as opposed to being relative to
the main ini file or the working directory.) If `xmldoc()` occurs in a NED
file, the file name is relative to the directory where that NED file was
loaded from.
- NED functions for reading (from file) and parsing (from string) of CSV,
JSON and XML files: `parseCSV()`, `readCSV()`, `parseExtendedCSV()`,
`readExtendedCSV()`, `parseJSON()`, `readJSON()`, `parseExtendedJSON()`,
`readExtendedJSON()`, `parseXML()`, `readXML()`. The "extended" variants support
expressions in the file, which will be evaluated during parsing. The XML
functions are aliases to the existing `xml()`/`xmldoc()` functions. Bonus
file-related functions: `readFile()`, `workingDir()`, `baseDir()`, `resolveFile()`,
`absFilePath()`.
- The body of a parametric submodule now allows assigning apparently
nonexistent parameters. For example, in the example below, the `sleepTime`
assignment does not cause an error if `FooApp` has a `sleepTime` parameter
but `IApp` does not:
app: <default("FooApp")> like IApp {
parameters:
address = parent.address;
sleepTime = 1s; // ignored if app has no 'sleepTime' parameter
}
- Implemented `@omittedTypename` property. `@omittedTypename` allows one to
specify a NED type to use when `typename=""` is specified for a parametric
submodule or channel. `@omittedTypename` can be specified on a module
interface or channel interface, or on a submodule or connection. It should
contain a single (optional) value. The value names the type to use. If it is
absent, the submodule or channel will not be created. (The connection will
be created without a channel object.)
- The `@mutable` property was introduced for parameters. If the module (or
channel) is prepared for a parameter to change its value at runtime (i.e.
the new value takes effect), then it should be marked with `@mutable`. If
`@mutable` is missing, then trying to change the parameter will now result
in a runtime error ("Cannot change non-mutable parameter".)
The motivation is that in a complex model framework, there is usually a
large number of (module or channel) parameters, and so far it has not been
obvious for users which parameters can be meaningfully changed at runtime.
For example, if a simple module did not implement `handleParameterChange()`
or the `handleParameterChange()` method did not handle a particular
parameter, then the user could technically change that NED parameter at
runtime, but the change did not take effect. This has often caused
confusion.
Parameters of `ned.DelayChannel` and `ned.DatarateChannel` are now marked
`@mutable`.
To allow running existing simulation models that have not yet been updated
with `@mutable` annotations, we have added the `parameter-mutability-check`
configuration option. Setting `parameter-mutability-check=false` will give
back the old behavior (not raising an error).
- Added the `expr()` operator to NED, with the purpose of allowing models to
accept formulas or expressions which it could use e.g. to determine the
processing time of a packet based on packet length or other properties,
decide whether a packet should be allowed to pass or should be filtered out
based on its contents (filter condition), or to derive x and y coordinates
of a mobile node in the function of time.
The argument to `expr()` is a NED expression which will typically contain free
variables, (like x and y in `expr(x+y)`). The `expr()` operator creates an
object that encapsulates the expression, so it can be assigned to parameters
of the type `object`. On the C++ side, the module implementation should
query the parameter to get at the expression object (of type
`cOwnedDynamicExpression`), and then it may bind the free variables and
evaluate the expression as often as it wishes.
- In `xml()` and `xmldoc()` element selectors, `$MODULE_INDEX`,
`$PARENTMODULE_NAME` and similar variables now evaluate to the empty string
if they are not applicable, instead of raising an error that was often
problematic.
- Improved error reporting during network building: when an error occurs
during assigning a parameter from a NED file, the error message now includes
the location of the assignment (file:line in NED file).
MSG:
- Made the hitherto experimental operation mode and feature set of the message
compiler official. This feature set was originally added around OMNeT++ 5.3,
and could be enabled by passing the `--msg6` option to `opp_msgtool`. There
was also a no-op `--msg4` option that selected the old (OMNeT++ 4.x
compatible) operation. Most of the OMNeT++ 6.0 pre-releases shipped with the
new operation mode being the default (i.e. `--msg6` became a no-op), with
features continually being added and refined. Then, finally, the old code
and the `--msg4` option were removed altogether.
The new operation mode represents a complete overhaul of the message
compiler, with significant non-backward-compatible changes to the MSG
language. These features were largely motivated by the needs of INET 4.
- The message compiler is now aware of the OMNeT++ library classes, as if
they were imported by default. Declarations come from `sim_std.msg`.
- Added import support. A message file can now reference definitions in
other message files using the `import` keyword. Type announcements are
no longer needed (in fact, they are ignored with a warning), and there
is now much less need for `cplusplus` blocks as well.
- Classes without an `extends` clause no longer have `cObject` as their
default base class. If `cObject` should be the base class, `extends cObject`
needs to be added explicitly.
- Field getters now return `const` reference. Separate `get..ForUpdate()`
getters that return non-`const` are generated to cover uses cases when the
contained value (typically an object) needs to be modified in-place.
- Added targeted `cplusplus` blocks, with the syntax of `cplusplus(<target>) {{..}}`.
The target can be `h` (the generated header file -- the default),
`cc` (the generated C++ file), `<classname>` (content is inserted into the
declaration of the type, just before the closing curly bracket), or
`<classname>::<methodname>` (content is inserted into the body of the
specified method). For the last one, supported methods include the
constructor, copy constructor (use `Foo&` as name), destructor, `operator=`,
`copy()`, `parsimPack()`, `parsimUnpack()`, etc., and the per-field
generated methods (setter, getter, etc.).
- Enum names can now be used as field type name, i.e. `int foo @enum(Foo)`
can now be also written as `Foo foo`.
- Support for `const` fields (no setter generated/expected).
- Support for pointer and owned pointer fields. Owned pointers are denoted
with the `@owned` field property. Non-owned pointers are simply stored and
returned; owned pointers imply delete-in-destructor and clone-on-dup
behavior. Owned pointer fields have a remover method generated for them
(`removeFoo()` for a `foo` field, or `removeFoo(index)` if the `foo` field
is an array). The remover method removes and returns the object in the field
or array element, and replaces it with a `nullptr`. Additionally, if the
object is a `cOwnedObject`, `take()` and `drop()` calls are also generated
into the bodies of the appropriate methods. There is also an `@allowReplace`
property that controls whether the setter method of an owned pointer field
is allowed to delete the previously set object; the default is
`@allowReplace(false)`.
- More convenient dynamic arrays: inserter, appender and eraser methods are
now generated into the class. For example `insertFoo(index,value)`,
`appendFoo(value)`, and `eraseFoo(index)` are generated for a `foo[]` field.
- Support for pass-by-value for fields. Annotate the field with `@byValue`
for that. `@byValue` and many other properties can also be specified on the
class, and they are inherited by fields that instantiate that type.
- Additional C++ base classes may be specified with the `@implements` property.
- The `@str` property causes an `str()` method to be generated; the expression
to be returned from the method should be given in the value of the property.
- The `@clone` property specifies code to duplicate (one array element of) the
field value.
- The `@beforeChange` class property specifies the name of a method to be
called from all generated methods that mutate the object, e.g. from setters.
It allows implementing objects that become immutable ("frozen") after an
initial setup phase.
- The `@custom` field property causes the field to only appear in descriptors,
but no code is generated for it at all. One can inject the code that
implements the field (data member, getter, setter, etc.) via targeted
`cplusplus` blocks.
- The `@customImpl` field property, suppresses generating implementations for
the field's accessor methods, allowing custom implementations to be supplied
by the user.
- Added the `@abstract` field and class property. For a field, it is
equivalent to the `abstract` keyword; for classes, it marks the whole
class as abstract.
- Abstract fields no longer require the class to be marked with `@customize`.
- Message files now allow more than one `namespace <namespace>;` directive.
The `namespace;` syntax should be used to return to the toplevel C++
namespace.
- The names of generated method can be overridden with the following field
properties: `@setter`, `@getter`, `@getterForUpdate`, `@sizeSetter`,
`@sizeGetter`, `@inserter`, `@eraser`, `@appender`, `@remover`, etc.
- Data types can be overridden with the following properties: `@cppType`,
`@datamemberType`, `@argType`, `@returnType`, `@sizeType`.
- Changed C++ type for array sizes and indices, i.e. the default of
`@sizeType`, from `int` to `size_t`.
- Added support for setting pointer members and array sizes via class
descriptors. (`cClassDescriptor` had no facility for that.)
This involves adding two methods to `cClassDescriptor` (`setFieldArraySize()`
and `setFieldStructValuePointer()`), and support for the `@resizable()` and
`@replaceable` field attributes that tell the message compiler to generate
the respective code in the class.
- The `@toString` and `@fromString` properties specify a method name or code
fragment to convert the field's value to/from string form in class
descriptors (`getFieldValueAsString()` and `setFieldValueFromString()`
methods of `cClassDescriptor`). In the absence of `@toString`, previous
versions converted the value to string by writing it to a stream using
`operator<<`; now the `str()` method of the object is used if it has one. If
neither `@toString` nor `str()` exist, an empty string is returned.
- Likewise, the `@toValue` and `@fromValue` properties specify a method name
or code fragment to convert the field's value to/from `cValue` form in class
descriptors ((`getFieldValue()` and `setFieldValue()` methods of
`cClassDescriptor`)).
- Better code for generated classes, e.g. inline field initializers, and use
of the `=delete` syntax of C++11 in the generated code.
- Better code generated for descriptors, e.g. symbolic constants for
field indices.
- The list of reserved words (words that cannot be used as identifiers in MSG
files; it is the union of the words reserved by C++ and by the MSG language)
has been updated.
- A complete list of supported properties (not all of them are explicitly
listed above) can be found in an Appendix of the Simulation Manual.
Ini files:
- It is now possible to break long lines without using a trailing backslash.
Continuation lines are marked as such by indenting them, i.e. an indented
line is now interpreted as a continuation of the previous line. (It is not
possible to break a line inside a string constant that way.) Breaking lines
using a trailing backslash way still works (and it can also be used to break
string constants, too). Indentation-based line continuation has the
advantage over backslashes that it allows placing comments on intermediate
lines (whereas with backslashes, the first `#` makes the rest of the lines
also part of the comment).
- The `Config` prefix in section headers is now optional, that is, the heading
`[Config PureAloha]` may now be also written as `[PureAloha]`, with the two
being equivalent.
Simulation kernel / Modules, channels, programming model:
- Added the `scheduleAfter()`, `rescheduleAt()`, `rescheduleAfter()` methods
to `cSimpleModule`. They are mainly for convenience, but using
`rescheduleAt()` instead of `cancelEvent()` + `scheduleAt()` will eventually
allow for a more efficient implementation.
- Change in the parameter change notification mechanism: Calls to the
`handleParameterChange()` method during initialization are no longer
suppressed. Because now every change results in a notification, the
umbrella `handleParameter(nullptr)` call at the end of the initialization
is no longer needed and has been removed. The consequence is that
`handleParameterChange()` methods need to be implemented more carefully,
because they may be called at a time when the module may not have
completed all initialization stages. Also, if an existing model relied on
`handleParameter(nullptr)` being called, it needs to be updated.
- Improvements in the multi-stage initialization protocol with regard to
dynamic module creation. Modules now keep track of the last init stage
they completed (`lastCompletedInitStage`). During an init stage, initialization
of modules is restarted if creation/deletion is detected during iteration;
modules already initialized in the previous round are recognized and skipped
with the help of `lastCompletedInitStage`.
- `cModule` now keeps track of submodule vectors as entities, and not just as
a collection of submodules with vector indices, meaning that we can now
distinguish between nonexistent and zero-size submodule vectors. Random
access of vector elements has also became more efficient (constant-time
operation). Several new methods have been added as part of this change:
`hasSubmoduleVector()`, `getSubmoduleVectorSize()`, `addSubmoduleVector()`,
`deleteSubmoduleVector()`, `setSubmoduleVectorSize()`, `getSubmoduleVectorNames()`.
- As part of the above change, several `cModule` and `cModuleType` methods have been
added or updated. A partial list:
- In `cModule`, the `hasSubmodule()`, `getSubmoduleNames()`, `hasGateVector()`,
`hasGates()` methods have been added for consistency between submodule and
gate APIs.
- The return type of the `getGateNames()` method has been changed from
`std::string<const char*>` to `std::vector<std::string>`, for consistency
with `getSubmoduleNames()`.
- `cModule`: added `setIndex()` and `setNameAndIndex()`.
- `cModule`, `cGate`: `getIndex()`, `getVectorSize()`, `gateSize()` and
similar methods now throw exception for non-vector submodules/gates.
- `cModule`: add separate `addGateVector()` method instead misusing `addGate()`
for creating gate vectors, also for consistency with `addSubmoduleVector()`.
- In `cModuleType::create()`, the `vectorSize` parameter of `create()` has
been removed.
- In `cModuleType::createScheduleInit()`, an index argument was added to
allow creating submodule vector elements.
- `cModule`: added `addSubmodule()` method which flows more naturally than
`cModuleType::create()`.
- There have been changes in submodule and channel iterators. `SubmoduleIterator`
has been rewritten due to the change in how submodule vectors are represented,
which may affect the iteration order in some cases. Iterators now throw an
exception if a change occurs in the list of submodules/channels during
iteration. Their APIs have also changed a little: `operator--` was removed,
and `init(m)` was renamed to `reset()`.
- Optimized `cModule::ChannelIterator` by letting `cModule` maintain a linked
list of channels (`cChannel`), so that `ChannelIterator` doesn't have to search
through the whole compound module to find them.
- Module name and full name (i.e. "name[index]") are now stringpooled, which
reduces memory usage in exchange for a small build-time extra cost.
In addition, string pools now use `std::unordered_map` instead of `std::map`,
which results in improved performance.
- `cComponent`: added `getNedTypeAndFullName()` and `getNedTypeAndFullPath()`.
They are especially useful in constructing error messages in NED functions.
Simulation kernel / Signals and notifications:
- `intpar_t` was renamed to `intval_t`, and `uintval_t` was added. Both are
guaranteed to be at least 64 bits wide.
- Signal listeners changed to use `intval_t` and `uintval_t` instead of `long`
and `unsigned long`. This change was necessary because `long` is only 32 bits
wide on Windows. This affects methods of `cListener` and subclasses like
`cResultFilter` and `cResultRecorder`.
- Emitting `nullptr` as a string (`const char*` overload of `emit()`) is
disallowed. The reason is that `nullptr` cannot be represented in
`std::string`, which causes problems e.g. in result filters and recorders.
- Added two new model change notifications: `cPostModuleBuildNotification`,
`cPostComponentInitializeNotification`.
- Minor changes in some model change notification classes. In
`cPreModuleAddNotification`, the `vectorSize` field was removed (as it was
redundant), and in `cPostModuleDeleteNotification`, the interpretation of
the index field has changed a little: if the deleted module was not part
of a module vector, index is now set to -1 instead of 0.
Simulation kernel / Utilities:
- Two utility functions were added to `cObject`: `getClassAndFullPath()` and
`getClassAndFullName()`. They are mostly useful in logging and error messages.
- `cMatchExpression`: The `field =~ pattern` syntax replaces `field(pattern)`.
Also removed the implicit OR syntax. The old syntaxes looked confusing, and
made it difficult to tell apart the concise notation from expression-style notation.
- Added `opp_component_ptr<T>`. It implements a smart pointer that points to
a `cComponent` (i.e. a module or channel), and automatically becomes `nullptr`
when the referenced object is deleted. It is a non-owning ("weak") pointer,
i.e. the pointer going out of scope has no effect on the referenced object.
`opp_component_ptr<T>` can be useful in implementing modules that hold
pointers to other modules and want to be prepared for those modules
getting deleted. It can also be useful for simplifying safe destruction
of compound modules containing such modules.
- New classes: `opp_pooledstring`, `opp_staticpooledstring`. They provide pool-
backed string storage (reference-counted and non-reference-counted,
respectively). In turn, the `cStringPool` class was removed; use either
of the pooled string classes or or `opp_staticpooledstring::get(const char *)`
instead.
- Several string functions have been made available for models. A
representative partial list: `opp_isempty()`, `opp_isblank()`,
`opp_nulltoempty()`, `opp_trim()`, `opp_split()`, `opp_splitandtrim()`,
`opp_join()`, `opp_stringendswith()`, `opp_substringbefore()`, etc.
- The `cStringTokenizer` class has been rewritten. It now supports features
like optional skipping of empty tokens, optional trimming of tokens,
optional honoring of quotes, optional honoring of parens/braces/brackets
(i.e. the input string is not broken into tokens in the middle of a
parenthesized expression).
Simulation kernel / Visualization support:
- Added display name support to modules. Display name is a string that
optionally appears in Qtenv next to (or instead of) the normal module
name, in order to help the user distinguish between similarly-named
submodules. For example, application-layer modules `app[0]`, `app[1]`, etc.
in INET may be given descriptive names like "file transfer", "video",
"voice", or "CBR", and have them displayed in Qtenv. Display names may be
set using the `display-name` per-module configuration option, or
programmatically by calling `setDisplayName()`.
- Added the `g=<group>` (layout group) display string tag, which makes it
possible to apply predefined arrangements like row, column, matrix or ring
to a group of unrelated submodules. This layouting feature was previously
only available for submodule vectors. When "g" tags are used, submodules
in the same group are now regarded for layouting purposes as if they
were part of the same submodule vector.
- Made it possible to specify display strings in the configuration. The
value given in the `display-string` per-component configuration option
is merged into the component's display string in the same way inheritance
or submodule display strings work: it may add, overwrite or remove items
from it.
- Added text alignment support to text and label figures: `cFigure::Alignment`
enum, `getAlignment()`/`setAlignment()` in `cAbstractTextFigure`.
- Added the `toAlpha()` method and a constructor taking `Color` to
`cFigure::RGBA`.
Simulation kernel / Transmission updates:
- The initial `send()` is interpreted as: "packet transmission begins now,
packet content and duration are, as things are now, going to be this".
Following that, an "update" (or any number of updates) can be sent.
An update is a packet with the updated ("actual") content, and with a
"remaining transmission duration" attached. Updates may only
be sent while transmission is still ongoing.
As an example, aborting a transmission is done by sending a
packet with a truncated content and a remaining duration of zero.
Transmission updates are paired with the original packet they modify
using a transmissionId. The transmissionId is normally chosen to be the
packet ID of the original transmission. Channels should understand
updates and handle them accordingly.
Receivers that receive the packet at the end of the reception, which is the
default operating mode, will only receive the final update. The original
packet and intermediate updates are absorbed by the simulation kernel.
Receivers that receive the packet at the start of the reception (see
`cGate::setDeliverImmediately()`, previously called
`setDeliverOnReceptionStart()`) should be prepared to receive all of the
original packet and the updates, and handle them appropriately. Tx updates
can be recognized from `cPacket::isUpdate()` returning `true`.
`cPacket::getRemainingDuration()` returns the remaining transmission
duration, and `cPacket::getDuration()` the total transmission duration.
As a safeguard against unprepared modules accidentally processing
tx updates as normal full-blown packets, the module is only given
tx updates if it explicitly declares that it is able to handle them
properly. The latter is done by the module calling
`setTxUpdateSupport(true)` before receiving packets, e.g. in `initialize()`.
Non-transmission channels treat tx updates in the same way as they treat any
other messages and packets (they ignore the `cPacket::isUpdate()` flag).
Details and related changes follow.
- `send()` and `sendDirect()` now accept a `SendOptions` struct where optional
parameters such as delay can be passed in. `sendDelayed()` and other
`send()`/`sendDirect()` variants now convert their extra args to a `SendOptions`,
and delegate to the "standard" `send()`/`sendDirect()` versions. `SendOptions` was
introduced as a means to handle combinatorial explosion of `send()` variants.
- For methods that participate in the send protocol (`cGate::deliver()`,
`cModule::arrived()`, `cChannel::processMessage()`), `SendOptions` was added.
- `cDatarateChannel` now allows the sender to explicitly specify the packet
duration in `SendOptions`, overriding the duration that the channel would
compute from the packet length and the channel datarate.
- `cDatarateChannel`'s datarate is now optional: set it to 0 or `nan`
to leave it unspecified. This change was necessary to support
transmitting frames with per-frame data rate selection. If the datarate
is unspecified, the packet duration must be supplied in the send call,
otherwise a runtime error will be raised.
- `cDatarateChannel`: non-packet messages now pass through without
interfering with packets.
- `cDatarateChannel`: disabled channels now let transmission updates through,
so that it is possible for the transmitter module to abort the ongoing
packet transmission.
- Tx updates (without duration/remainingDuration) are allowed on paths without
transmission channels.
- In `cChannel::processMessage()`, `result_t` was renamed `cChannel::Result`,
and it is now a proper return value (not an output parameter).
- `remainingDuration` was added to `cChannel::Result`.
- `cDatarateChannel` now optionally allows multiple concurrent transmissions,
with or without any bookkeeping and associated checks. This is useful for
modeling a channel with multiple subchannels or carriers. The operating mode
has to be selected programmatically, with the channel's `setMode()` method.
Possible modes are `SINGLE`, `MULTI` and `UNCHECKED`.
- The `forceTransmissionFinishTime()` method of channels has been deprecated.
It was always meant as a temporary device to allow implementing aborting
frame transmissions, and now with the arrival of the new transmission
update API there is no reason to use it any more. Simulations using it
should be migrated to the new API.
- Renamed `setDeliverOnReceptionStart()` to `setDeliverImmediately()`.
- Added `cSimpleModule::supportsTxUpdates()` flag.
- `cPacket` now carries a `remainingDuration` field.
- `cPacket`: eliminated `FL_ISRECEPTIONSTART`; `isReceptionStart()` now uses
`remainingDuration` as input; added a similar `isReceptionEnd()` method.
- `cPacket::str()` overhaul to reflect new fields and uses.
- In the APIs, send delay and propagation delay, which were sort of
combined into a single value, are now distinct values, handled
separately.
Simulation kernel / Module deletion:
- Added the `preDelete()` method to `cComponent`. This is an initially empty
virtual function that the user can override to add tasks to be done
before the module (or channel) is deleted. When `deleteModule()` is called
on a compound module, it first invokes `preDelete()` for each module in the
submodule tree, and only starts deleting modules after that. `preDelete()`
can help simplify network or module deletion in a complex simulation that
involves model change listeners.
- `cIListener`'s destructor now unsubscribes from all places it was subscribed
to. This change was necessitated by the following `deleteModule()` change.
- `deleteModule()`: Module destruction sequence was changed so that when
deleting a compound module, the compound module's local listeners are
notified about the deletion of the submodules.
- `deleteModule()` internals refactored. The motivation was to avoid doing
things like firing pre-model-change notifications from a halfway-deleted
module. Now we do every potentially risky thing (such as deleting submodules
and disconnecting gates) from `doDeleteModule()`, and only delete the module
object when it is already barebones (no submodules, gates, listeners, etc).
With this change, the deletion sequence is now pretty much the reverse of
the setup sequence.
- Now it is allowed for modules to be deleted (including self-deletion) and
created at will during initialization.
Simulation kernel / Expressions, object parameters, JSON values:
- Under the hood, all expression parsing and evaluation tasks now use the same
new generic extensible expression evaluator framework. It is used for NED
expressions, object matching, scenario constraint, statistics recording,
result selection in the Simulation IDE and in `opp_scavetool`, in
`cDynamicExpression` and `cMatchExpression`, etc. In the new framework,
expression parsing and the translation of the AST to an evaluator tree are
done in separate steps, which makes the library very versatile. Evaluators
include support for shortcutting logical and conditional operators, constant
folding, and an `undefined` value (anything involving `undefined` will evaluate
to `undefined`).
- `cNedValue` was renamed to `cValue` (compatibility typedef added), as it is
now a generic value container used throughout the simulation kernel (`cPar`,
`cExpression`, `cClassDescriptor`, etc.), i.e. it is no longer specific to NED.
- `cValue`'s `doubleValue()` and `intValue()` methods now throw an exception when
called on a value that has a measurement unit, in order to reduce usage
mistakes. If the value has a unit, call either `doubleValueInUnit()` /
`intValueInUnit()`, or `doubleValueRaw()`/`intValueRaw()` plus `getUnit()`.
- `cValue` changed to hold `any_ptr` (see later) instead of `cObject*`. This
change involves several changes, e.g. type `OBJECT` renamed to `POINTER`,
and `pointerValue()` added.
- `cPar`: Added support for object parameters. New type constant: `OBJECT`.
New methods: `setObjectValue()`, `objectValue()`, `operator=(cObject*)`,
`operator cObject*`.
- `cPar`: Added `cValue`-based generic access: `getValue()`, `setValue()`.
- Store origin (file:line) info in `cPar` parameters (more precisely, in
`cDynamicExpression`), so we can report it on evaluation errors.
Most visible change: `cPar::parse()` gained an extra `FileLine` argument.
Also, `cDynamicExpression` now has `get/setSourceLocation()`.
- Added `cValueArray` and `cValueMap` classes for representing JSON data in
NED expressions. A third class is `cValueHolder`, a wrapper around `cValue`,
which is only used when a non-object value (double, string, etc) is assigned
to a NED parameter of the type `object`. All three classes subclass from
`cValueContainer`. Note that behavior of the `dup()` methods of
`cValueArray` and `cValueMap` is consistent with that of `cArray` and
`cQueue`, i.e. only those objects that are owned by the cloned container are
duplicated.
- NED functions that take or return values of type `object` are now allowed.
- NED functions can now be defined with the alternative signature:
cValue f(cExpression::Context *context, cValue argv[], int argc)
in addition to the existing signature
cValue f(cComponent *contextComponent, cValue argv[], int argc)
The `cExpression::Context` argument allows one to access the context
component, and also the directory where the ini file entry or the
NED file containing the expression occurred (the "base directory").
`Define_NED_Function()` accepts both signatures. The base directory
is useful for functions like `xmldoc()` that want to access files
relative to the location of the NED expression.
- `cNedFunction` now allows to search for NED functions by name AND accepted
number of args.
- `cDynamicExpression` has been reimplemented using the new internal
`Expression` class, and support for user-defined variables, members,
methods, and functions was added. As a consequence, the public interface of
the class has significantly changed as well.
- Added the `cOwnedDynamicExpression` class which holds the result of a NED
`expr()` operator. `cOwnedDynamicExpression` is both `cOwnedObject` and
`cDynamicExpression` (multiple inheritance). To make this possible, the
`cObject` base class was removed from `cExpression`.
- `cClassDescriptor`: Use exception instead of returning `false` for
indicating error. The return types of the following methods changed
from `bool` to `void`: `setFieldValueAsString()`, `setFieldArraySize()`,
`setFieldStructValuePointer()`.
- `cClassDescriptor`: Added support for setting pointer members and array
sizes via class descriptors. New methods: `setFieldArraySize()`,
`setFieldStructValuePointer()`.
- `cClassDescriptor`: Added `getFieldValue()`/`setFieldValue()` methods to
allow accessing fields in a typed way, using `cValue`. Previously existing
methods `getFieldValueAsString()`/`setFieldValueAsString()` only allowed
string-based access. In MSG files, the `@toValue()` and `@fromValue()`
properties can be used to provide code to convert objects or fields to
`cValue`.
- `cClassDescriptor`: Methods changed to use `any_ptr` instead of `void*`
for passing the object. (`any_ptr` is a smart pointer class that provides
type safety for `void*` pointers.) Pointers need to be put into and extracted
from `any_ptr` using the new `toAnyPtr()` / `fromAnyPtr()` functions. They have
specialized versions for each type (via templates and overloading).
For new types, the message compiler generates `toAnyPtr()`/`fromAnyPtr()`
in the header file. For the simulation library classes, these methods
come from `sim_std_m.h` (generated from `sim_std.msg`); `sim_std_m.h`
is now part of `<omnetpp.h>`.
Simulation kernel / Fingerprints:
- Due a bugfix in `cHasher::add(const char *)`, fingerprints that involve
hashing strings changed their values.
- The implementation of `cHasher::add(const std::string&)` was changed to be
consistent with the `add(const char *)` overload. This may cause fingerprint
changes in models that use it.
- Changed the way fingerprints are computed from figures. Most importantly,
fingerprints are now affected by all visual properties, not just geometry
information. This change only affects fingerprints that contain the 'f'
(=figures) ingredient.
- The introduction of the new expression evaluation framework also somewhat
affects fingerprints. The fact that logical operators and inline-if are now
shortcutting may change the fingerprint of some simulations, due to
consuming fewer random numbers during expression evaluation.
Simulation kernel / Miscellaneous:
- The `getModuleByPath()` method was changed to never return `nullptr`, even if
an empty string is given as path. Instead, it will throw an exception if the
module was not found. This change makes this method consistent with other
getter methods in the simulation library, and allows `nullptr` checks to be
removed from model code that uses it. A new method, `findModuleByPath()` was
added for cases when an optionally existing module needs to be found. These
methods, initially defined on `cModule`, have been moved to `cComponent` so
that they can be called on channels too.
- Signature change of the `cVisitor::visit(cObject *obj)` virtual method: it
can now request end of iteration via returning `false` (hence, return type
changed from `void` to `bool`) instead of throwing `EndTraversalException`.
Existing `cVisitor` subclasses in model code will need to be adjusted.
- `cPar`: Implemented `isMutable()` and the mechanism behind the new `@mutable`
property.
- `cProperty`: Added `getNumKeys()` method; `updateWith()` made public.
- `cConfiguration`: Removed `getParameterKeyValuePairs()`. Instead,
`getKeyValuePairs()` made smarter with an extra `flags` parameter
to be able to handle the various use cases.
- `cMessage`: Allowed `isMessage()` to be called from subclasses.
- `cEnvir`: New result recording related methods: `recordComponentType()`,
`recordParameter()`.
- `cEnvir`: Added `getConnectionLine()`, which returns the coordinates of a
connection arrow. This is for certain custom animations.
- `cEnvir`: Added `pausePoint()`, an animation-related experimental API.
- Result filters: Two new methods in the `cResultListener` interface:
`emitInitialValue()` and `callEmitInitialValue()`.
- `cResultFilter`, `cResultRecorder`: Grouped `init()` args into a `Context` struct,
The old `init()` methods have been preserved as deprecated (and invoked from
the new `init()`) in case an existing filter/recorder overrides them. Note
that potential external calls to the old `init()` method won't work any more
(they will have no effect), and need to be changed to the new version.
- Added `MergeFilter`, a result filter that allows multiple inputs,
and multiplexes them onto its singe output. It is available (as the
`merge()` function) in the `source=` part of `@statistic`.
- Fixed histogram loading issue in the output scalar file (.sca). Bin edges
that are very close could become equal in the file if insufficient printing
precision was set, rendering the file unreadable. The issue is now handled
both during result file writing (if such condition is detected, bin edges
are written with full [16-digit] precision) and reading (zero-width bins are
merged into adjacent nonzero-width bin).
Simulation kernel / Cleanup:
- Removed obsolete/deprecated classes and methods. A partial list:
`cVarHistogram`, `cLegacyHistogram`, `cLongHistogram`, `cDoubleHistogram`,
`cWeightedStdDev`, `cDensityEstBase`; `detailedInfo()` method; `timeval_*()`
functions; `cHistogram` methods `setRangeAuto()`, `setRangeAutoLower()`,
`setRangeAutoUpper()`, `setNumCells()`, `setCellSize()`; `operator()` of iterator