Skip to content

Commit 9bbac67

Browse files
authored
Merge pull request #7 from SimIntToolkit/late_joiner
Added the JSON Configurations parsing for federates
2 parents a9076d0 + ddd4b3c commit 9bbac67

33 files changed

Lines changed: 2632 additions & 136 deletions

File tree

Lines changed: 330 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,330 @@
1+
# ================================
2+
# Portico RTI Initialization Data
3+
# ================================
4+
# This file contains all available configuration options for Portico.
5+
# Values are initially commented out and are provided shown with their default settings.
6+
#
7+
# All options are formatted as name=value pairs, the '#' and '!' characters mark comment lines
8+
#
9+
# To make use of this file, put it in the directory that your federate is executed from, or set the
10+
# RTI_RID_FILE environment variable to point at wherever it is located.
11+
#
12+
13+
# ===================================
14+
# 1. General Portico Logging Options
15+
# ===================================
16+
# (NOTE) Some sub-components have their own log settings. See the sections relaing to them for
17+
# those particular properties.
18+
19+
# (1.1) Portico Log Directory
20+
# Specify the directory to put the Portico log-files into. This defaults to "logs" and
21+
# if a relative path is used, it will be releative to the location of the process that
22+
# executed Portico
23+
#
24+
# portico.logdir = logs
25+
26+
# (1.2) Portico Log Level
27+
# Specify the level that Portico will log at. Valid values are: TRACE, DEBUG, INFO, WARN,
28+
# ERROR, FATAL, OFF. The default value is "WARN".
29+
#
30+
# portico.loglevel = INFO
31+
32+
# (1.3) Print FOM when federate Joins
33+
# When a federate joins a federation, Portico can pretty-print the FOM data of that
34+
# federation. If this is enabled, the FOM is logged to the INFO level (so make sure you
35+
# have logging turned up high enough). By default this is disabled.
36+
#
37+
# portico.fom.print = disabled
38+
39+
# (1.4) Logging by Handle/Name
40+
# Making sense of log files can be difficult. To help make sense of this data, various bits
41+
# of HLA information can be logged by their HLA handle or their name. For example, an HLA
42+
# object class can be logged by its handle, or by its name.
43+
#
44+
# Any items specified in logWithHandles are logged using their handles (and vice versa for
45+
# logWithNames). The format of these properties is a comma-separated list containing any of
46+
# the following identifiers (defaults specified in parentheses):
47+
#
48+
# objectClass (handle)
49+
# attributeClass (handle)
50+
# interactionClass (handle)
51+
# parameterClass (handle)
52+
# objectInstance (name)
53+
# space (handle)
54+
# dimension (handle)
55+
# federate (name)
56+
#
57+
# (NOTE) You only have to specify the bits you want. If a value isn't specified in either
58+
# list, it will assume its default value. If a value is specified in both lists, the
59+
# logWithNames takes precedence.
60+
#
61+
# portico.logWithHandles=objectClass,attributeClass,interactionClass,parameterClass,space,dimension
62+
# portico.logWithNames=objectInstance,federate
63+
64+
65+
# ================================
66+
# 2. HLA Related RTI Properties
67+
# ================================
68+
# These settings relate to how the RTI works with regard to HLA operations
69+
70+
# (2.1) Management Object Model
71+
# This controls whether or not the MOM is enabled. By default it is turned on, but if you
72+
# don't want it you can turn it off. Valid values are "enabled" and "disabled"
73+
#
74+
# portico.mom = enabled
75+
76+
# (2.2) Save/Restore Data Files Directory
77+
# This specifies the path to the directory where federate save/restore data files are stored.
78+
# By default, this is the "savedata" directory relative to the directory that the federate
79+
# was launched from. Any valid operating system path can be specified, as long as it is
80+
# writeable by the operating system user under which the federate is executing
81+
#
82+
# portico.saveDirectory = ./savedata
83+
84+
# (2.3) Unsupported Methods Throw Exceptions
85+
# Portico does not support all the RTIambassador methods in all interface versions. To alert
86+
# users to situations where a method is called that isn't support, Portico will log a warning
87+
# and take no action. This is often a non-fatal action, but in some situations it may cause
88+
# federates to stall or misbehave. As such, if this value is set to true, an RTIinternalError
89+
# will be thrown when an unsupported method is called. By default, this is false.
90+
#
91+
# portico.unsupportedExceptions = false
92+
93+
# (2.4) Object Names Negotiated With Federation
94+
# When registering an object with a specific name, to ensure that name is unique, the
95+
# federate much negotiate with the rest of the federation. This incurs a performance hit.
96+
# By default, this negotiation is turned off. If you have problems with conflicting names,
97+
# set this property to true. In the default mode (negotiation disabled) the RTI is not
98+
# totally standards compliant, and conflicts can occur if federates try to register objects
99+
# with the same name at the same time (if the requests are sufficiently spaced out in time,
100+
# this problem shouldn't occur).
101+
#
102+
# portico.object.negotiateNames = false
103+
104+
# (2.5) Unique Federate Names
105+
# By default, Portico, like other RTIs, will ensure that all federates in a federation have
106+
# unique names. However, in some situations this is not desirable (like running Portico with
107+
# JSAF or VBS2). In this case, you can turn the unique name checking to false. When you do
108+
# this, what happens is that when Portico sees a name conflict, rather than throwing an
109+
# exception it will change the requested name from "name" to "name (handle)" thus making it
110+
# unique. Default is true, set to false to turn unique name checking off.
111+
#
112+
# portico.uniqueFederateNames = true
113+
114+
115+
# ================================
116+
# 3. Advanced Options
117+
# ================================
118+
# These really shouldn't be changed unless you really know what you want
119+
120+
# (3.1) Portico Communications Binding
121+
# Defines the mechanism used by federates to communicate. Two valid options: jgroups, jvm.
122+
#
123+
# jgroups: Use for LAN/WAN communications (default)
124+
# jvm: Use when running many federates in separate threads within a single process.
125+
#
126+
# portico.connection = jgroups
127+
128+
# (3.2) LRC Tick Timeout
129+
# When a federate calls tick() and there is no work to do, the LRC will wait for a period of
130+
# time to allow work to arrive before it returns. This is designed to avoid a busy-looping
131+
# situation where people are calling tick in a loop while waiting for some event.
132+
#
133+
# The period of time the LRC will wait is specified by this value (in *MILLISECONDS*).
134+
# DEFAULT = 5
135+
#
136+
# (NOTE) This does not apply to the tick(min,max) call (in that case, the LRC will wait
137+
# for at most "min" seconds for work to arrive).
138+
#
139+
# portico.lrc.tt = 5
140+
141+
142+
# =========================================
143+
# 4. JGroups Network Settings
144+
# =========================================
145+
# Portico uses the JGroups library for its inter-federate network communication.
146+
# These settings control various parameters of the network layer and JGroups itself.
147+
148+
# (4.1) JGroups UDP Address and Port
149+
# Address and port to use for communication between federates.
150+
# DEFAULT: 239.20.9.13:20913
151+
#
152+
# portico.jgroups.udp.address = 239.20.9.13
153+
# portico.jgroups.udp.port = 20913
154+
155+
156+
# (4.2) JGroups Bind Address
157+
# The address/NIC Portico should use. Can use an IP address associated with a NIC, or
158+
# one of the following special values:
159+
#
160+
# GLOBAL: Pick a global IP address if available. If not, falls back to a SITE_LOCAL IP address.
161+
# SITE_LOCAL: Picks a site local (non routable) IP address, e.g. from the 192.168.0.0 or 10.0.0.0 address range.
162+
# LINK_LOCAL: Picks a link-local IP address, from 169.254.1.0 through 169.254.254.255.
163+
# NON_LOOPBACK: Picks any non loopback address.
164+
# LOOPBACK: Pick a loopback address, e.g. 127.0.0.1.
165+
# match-interface: Pick an address which matches a pattern against the interface name, e.g. match-interface:eth.*
166+
# match-address: Pick an address which matches a pattern against the host address, e.g. match-address:192.168.*
167+
# match-host: Pick an address which matches a pattern against the host name, e.g. match-host:linux.*
168+
#
169+
# DEFAULT: SITE_LOCAL
170+
#
171+
portico.jgroups.udp.bindAddress = SITE_LOCAL
172+
173+
174+
# (4.3) JGroups UDP Sent/Receive Buffer Size
175+
# Incoming/Outgoing buffer sizes. Default receive buffer is quite large to allow ample
176+
# space on fast networks and avoid dropped packets.
177+
#
178+
# portico.jgroups.udp.receiveBuffer = 25M
179+
# portico.jgroups.udp.sendBuffer = 640K
180+
181+
182+
# (4.4) JGroups Bundling Support
183+
# If you are sending lots of smaller messages, higher overall throughput can be obtained by
184+
# bundling them together into a fewer number of larger messages. However, doing so comes at
185+
# the cost of latency. Messages are buffered until either the timeout period (milliseconds)
186+
# is reached, or the total size of the messages exceeds the specified threshold. Bundling
187+
# is enabled by default. For latency-critical tasks, disable it or reduce the max-timeout.
188+
#
189+
# portico.jgroups.bundling = true
190+
# portico.jgroups.bundling.maxSize = 64K
191+
# portico.jgroups.bundling.maxTime = 30
192+
193+
194+
# (4.5) JGroups Flow Control
195+
# Flow control is used to rate limit transmission so that slow receivers don't get overrun,
196+
# causing them to drop messages and requiring expensive retransmission.
197+
#
198+
# This value sets the maximum number of bytes that can be sent by a federate before it
199+
# needs to receive more credits from other cluster members. These credits are not sent
200+
# until the other federates have processed enough of the prior sent messages. The ratio
201+
# setting defines how far through its current credits a sender can get before it should
202+
# issue a request for more.
203+
#
204+
# Setting the credit limit higher will allow a federate to send more messages before it
205+
# gets blocked. Consider adjusting this value in conjunction with the buffer sizes, as
206+
# they will dictate storage capacity on the sender side.
207+
#
208+
# Note: If you start experiencing unstable behaviour, turn this value down. Flow control
209+
# can be sensitive to the number of messages you try to send out in a hurry. If
210+
# bundling is enabled, you can use a higher value because although you are sending
211+
# more messages, the actual number hitting the network is smaller.
212+
#
213+
# portico.jgroups.flow.credits = 2M
214+
# portico.jgroups.flow.threshold = 0.4
215+
216+
217+
# (4.6) Packet Fragmentation Size
218+
# Messages larger than this size will be broken down into smaller ones for transmission,
219+
# reducing potentially lengthy delays retransmitting whole large messages when a single
220+
# datagram is lost.
221+
# Note: The max bundling size must be greater than this value.
222+
#
223+
# portico.jgroups.frag.size = 60K
224+
225+
226+
# (4.7) JGroups Traffic Auditing
227+
# If this option is enabled a special log file will be produced for each federate listing
228+
# the messages it has sent and received, along with their size and other useful details.
229+
# This information can be used to make judgements about network config (such as bundling
230+
# limits) or to just see what is happening in the federation at a network level.
231+
#
232+
# The audit files are placed in the logs directory (see sec 1.1) with the name:
233+
# "audit-FEDERATENAME.log"
234+
#
235+
# If the auditor is enabled you can specify a detail level to control what is logged.
236+
# When set to "full", each message will be logged with its specific details. (default)
237+
# When set to "summary", only the summary tables will be printed
238+
#
239+
# portico.jgroups.auditor.enabled = false
240+
# portico.jgroups.auditor.details = full
241+
242+
# (4.8) JGroups Traffic Audit Filtering
243+
# Federates can generate a lot of messages. Sometimes you really just want to zero in
244+
# on a particular type of message, or messages for a particular FOM type. These filters
245+
# let you do that. These filters work in combination. For example, consider the following:
246+
# - action = sent
247+
# - type = UpdateAttributes
248+
# - fomtype = Lifeform, GroundVehicle
249+
#
250+
# Given this, only attribute updates for the FOM classes "Lifeform" and "GroundVehicle"
251+
# that the local federate sends will be logged. Leaving a value empty, or using the
252+
# keyword "all" will cause no filtering for that type to be applied.
253+
#
254+
# NOTE: If the detail level is set to "summary", -no- individual messages will be logged,
255+
# regardless of the filter settings.
256+
#
257+
# portico.jgroups.auditor.filter.direction =
258+
# portico.jgroups.auditor.filter.message =
259+
# portico.jgroups.auditor.filter.fomtype =
260+
261+
# =========================================
262+
# 5. WAN Connection Options
263+
# =========================================
264+
265+
# (5.1) WAN Mode Enable/Disable
266+
# If true, WAN mode will be enabled and this federate will act as both a
267+
# local participant, and also as a bridge for all the local federates.
268+
# Messages exchanged on the local JGroups channel will be forwarded to a
269+
# central router (see 5.2) to be reflected out to other sites. Messagest
270+
# received from the router will be pushed out to the local JGroups channel
271+
# so everyone here can process them.
272+
#
273+
# Note that this mode does not support bundling. If enabled in the RID, it
274+
# will be active on the local JGroups network, but ignored for the WAN.
275+
#
276+
# Note: Router must be running before federate startup. If not - federates
277+
# will fail to start.
278+
#
279+
# Default: false
280+
#
281+
# portico.wan.enabled = false
282+
283+
# (5.2) Router Address/Port
284+
# Specifies the address and port of the WAN router to use. Note that the
285+
# syntax is "address:port".
286+
#
287+
# Default: 127.0.0.1:23114
288+
#
289+
# portico.wan.router = 127.0.0.1:23114
290+
291+
# (5.2) Enable / Disable Bundling
292+
# Bundling enables higher throughput by grouping together a number of
293+
# smaller messages and sending them as one. This makes much more efficient
294+
# use of the network and provides considerable improvements to throughput
295+
# at a minor cost to latency.
296+
#
297+
# If enabled, the subsequent options will control how it is applied.
298+
#
299+
# Default: true
300+
#
301+
# portico.wan.bundle.enabled = true
302+
303+
# (5.3) Max Bundle Size
304+
# Messages sent over the WAN will be grouped into bundles and sents as
305+
# a batch when their total size exceeds this value. Specify a size with
306+
# a suffix of 'b', 'k' or 'm' (or 'g' if you dare!)
307+
#
308+
# Default: 64k
309+
#
310+
# portico.wan.bundle.maxsize = 64K
311+
312+
# (5.4) Max Bundle Timeout
313+
# The maximum amount of time we will hold messages in the bundler for while
314+
# waiting for more messages to arrive and bundle together. From the time that
315+
# a message is received, the bundler will hold it for no longer than this
316+
# value (specified in milliseconds).
317+
#
318+
# Default: 20
319+
#
320+
# portico.wan.bundle.timeout = 20
321+
322+
323+
# =========================================
324+
# A51. Undocumented Settings
325+
# =========================================
326+
# This section is a catch-all of settings we use for internal work, and infrequently.
327+
# Their specific usecase and function is undocumented as they are not intended for general use.
328+
# portico.container.loglevel = OFF
329+
# portico.jgroups.loglevel = OFF
330+
# portico.jgroups.timeout = 1000
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"script": {
3+
"expect": [
4+
{
5+
"federateType": "PingCounter1"
6+
},
7+
{
8+
"federateType": "Sink1"
9+
},
10+
{
11+
"federateType": "Source1"
12+
}
13+
],
14+
"pauses": [],
15+
"coaNodes": [],
16+
"coaEdges": []
17+
}
18+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"federateTypesAllowed": [
3+
"PingCounter",
4+
"PingCounter2",
5+
"Sink",
6+
"Sink2",
7+
"Source",
8+
"Source2"
9+
],
10+
"expectedFederates": [
11+
{
12+
"federateType": "PingCounter",
13+
"count": 1
14+
},
15+
{
16+
"federateType": "PingCounter2",
17+
"count": 1
18+
},
19+
{
20+
"federateType": "Sink",
21+
"count": 1
22+
},
23+
{
24+
"federateType": "Sink2",
25+
"count": 1
26+
},
27+
{
28+
"federateType": "Source",
29+
"count": 1
30+
},
31+
{
32+
"federateType": "Source2",
33+
"count": 1
34+
}
35+
],
36+
"lateJoinerFederates": []
37+
}

0 commit comments

Comments
 (0)