Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NetworkedGraphicsMV3500
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Savage
NetworkedGraphicsMV3500
Commits
76fdc795
Commit
76fdc795
authored
3 years ago
by
Brutzman, Don
Browse files
Options
Downloads
Patches
Plain Diff
simpler usage of channelOpenDis7
parent
b926358f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/src/SimkitOpenDis7Examples/ArrivalProcessOpenDis7.java
+12
-8
12 additions, 8 deletions
...es/src/SimkitOpenDis7Examples/ArrivalProcessOpenDis7.java
with
12 additions
and
8 deletions
examples/src/SimkitOpenDis7Examples/ArrivalProcessOpenDis7.java
+
12
−
8
View file @
76fdc795
...
@@ -26,14 +26,14 @@ public class ArrivalProcessOpenDis7 extends SimEntityBase {
...
@@ -26,14 +26,14 @@ public class ArrivalProcessOpenDis7 extends SimEntityBase {
*/
*/
protected
int
numberArrivals
;
protected
int
numberArrivals
;
/**
i
nitializ
ation
*/
/**
I
nitializ
e channel setup for OpenDis7 and report a test PDU
*/
private
void
initialize
()
private
void
initialize
ChannelOpenDis7
()
{
{
getC
hannelOpenDis7
()
.
setUpNetworkInterface
();
c
hannelOpenDis7
.
setUpNetworkInterface
();
getC
hannelOpenDis7
()
.
printlnTRACE
(
"opendis7.getNetworkAddress()="
+
getC
hannelOpenDis7
()
.
getNetworkAddress
()
+
c
hannelOpenDis7
.
printlnTRACE
(
"opendis7.getNetworkAddress()="
+
c
hannelOpenDis7
.
getNetworkAddress
()
+
", getNetworkPort()="
+
getC
hannelOpenDis7
()
.
getNetworkPort
());
", getNetworkPort()="
+
c
hannelOpenDis7
.
getNetworkPort
());
getC
hannelOpenDis7
()
.
sendCommentPdu
(
VariableRecordType
.
OTHER
,
"ArrivalProcessOpenDis7 initialized"
);
c
hannelOpenDis7
.
sendCommentPdu
(
VariableRecordType
.
OTHER
,
"ArrivalProcessOpenDis7 initialized"
);
}
}
/**
/**
...
@@ -44,7 +44,7 @@ public class ArrivalProcessOpenDis7 extends SimEntityBase {
...
@@ -44,7 +44,7 @@ public class ArrivalProcessOpenDis7 extends SimEntityBase {
*/
*/
public
ArrivalProcessOpenDis7
(
RandomVariate
interarrivalTimeGenerator
)
{
public
ArrivalProcessOpenDis7
(
RandomVariate
interarrivalTimeGenerator
)
{
this
.
interarrivalTimeGenerator
=
interarrivalTimeGenerator
;
this
.
interarrivalTimeGenerator
=
interarrivalTimeGenerator
;
initialize
();
initialize
ChannelOpenDis7
();
}
}
/**
/**
...
@@ -53,7 +53,7 @@ public class ArrivalProcessOpenDis7 extends SimEntityBase {
...
@@ -53,7 +53,7 @@ public class ArrivalProcessOpenDis7 extends SimEntityBase {
* explicit call to its setter method.
* explicit call to its setter method.
*/
*/
public
ArrivalProcessOpenDis7
()
{
public
ArrivalProcessOpenDis7
()
{
initialize
();
initialize
ChannelOpenDis7
();
}
}
/**
/**
...
@@ -71,6 +71,8 @@ public class ArrivalProcessOpenDis7 extends SimEntityBase {
...
@@ -71,6 +71,8 @@ public class ArrivalProcessOpenDis7 extends SimEntityBase {
*/
*/
public
void
doRun
()
{
public
void
doRun
()
{
firePropertyChange
(
"numberArrivals"
,
getNumberArrivals
());
firePropertyChange
(
"numberArrivals"
,
getNumberArrivals
());
// TODO send simulation management PDUs via DIS channel, announce commencement
waitDelay
(
"Arrival"
,
interarrivalTimeGenerator
);
waitDelay
(
"Arrival"
,
interarrivalTimeGenerator
);
}
}
...
@@ -84,6 +86,8 @@ public class ArrivalProcessOpenDis7 extends SimEntityBase {
...
@@ -84,6 +86,8 @@ public class ArrivalProcessOpenDis7 extends SimEntityBase {
int
oldNumberArrivals
=
getNumberArrivals
();
int
oldNumberArrivals
=
getNumberArrivals
();
numberArrivals
+=
1
;
numberArrivals
+=
1
;
firePropertyChange
(
"numberArrivals"
,
oldNumberArrivals
,
getNumberArrivals
());
firePropertyChange
(
"numberArrivals"
,
oldNumberArrivals
,
getNumberArrivals
());
// TODO announce selected arrivals via DIS channel
waitDelay
(
"Arrival"
,
interarrivalTimeGenerator
);
waitDelay
(
"Arrival"
,
interarrivalTimeGenerator
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment