Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Simonstrator
PeerfactSim.KOM
Commits
a8488c41
Commit
a8488c41
authored
Jun 21, 2017
by
Tobias Meuser
Committed by
Jose Ignacio Monreal Bailey
Aug 20, 2019
Browse files
Added speed to SiSTypes, provided by DefaultTopologyComponent
parent
02e300e9
Changes
1
Show whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/DefaultTopologyComponent.java
View file @
a8488c41
...
@@ -134,7 +134,6 @@ public class DefaultTopologyComponent implements TopologyComponent {
...
@@ -134,7 +134,6 @@ public class DefaultTopologyComponent implements TopologyComponent {
position
.
set
(
placementModel
.
place
(
this
));
position
.
set
(
placementModel
.
place
(
this
));
}
}
if
(
registerAsInformationProviderInSiS
)
{
try
{
try
{
final
SiSComponent
sis
=
host
.
getComponent
(
SiSComponent
.
class
);
final
SiSComponent
sis
=
host
.
getComponent
(
SiSComponent
.
class
);
sis
.
provide
().
nodeState
(
SiSTypes
.
PHY_LOCATION
,
sis
.
provide
().
nodeState
(
SiSTypes
.
PHY_LOCATION
,
...
@@ -165,6 +164,34 @@ public class DefaultTopologyComponent implements TopologyComponent {
...
@@ -165,6 +164,34 @@ public class DefaultTopologyComponent implements TopologyComponent {
}
}
});
});
sis
.
provide
().
nodeState
(
SiSTypes
.
SPEED
,
new
SiSDataCallback
<
Double
>()
{
Set
<
INodeID
>
localID
=
INodeID
.
getSingleIDSet
(
getHost
().
getId
());
@Override
public
Double
getValue
(
INodeID
nodeID
,
SiSProviderHandle
providerHandle
)
throws
InformationNotAvailableException
{
if
(
nodeID
.
equals
(
getHost
().
getId
()))
{
return
getMovementSpeed
();
}
else
{
throw
new
InformationNotAvailableException
();
}
}
@Override
public
Set
<
INodeID
>
getObservedNodes
()
{
return
localID
;
}
@Override
public
SiSInfoProperties
getInfoProperties
()
{
return
new
SiSInfoProperties
();
}
});
// Provide Underlay topology
// Provide Underlay topology
Event
.
scheduleImmediately
(
new
EventHandler
()
{
Event
.
scheduleImmediately
(
new
EventHandler
()
{
...
@@ -176,7 +203,6 @@ public class DefaultTopologyComponent implements TopologyComponent {
...
@@ -176,7 +203,6 @@ public class DefaultTopologyComponent implements TopologyComponent {
getTopologyID
(
NetInterfaceName
.
WIFI
,
true
),
getTopologyID
(
NetInterfaceName
.
WIFI
,
true
),
DefaultTopologyComponent
.
class
);
DefaultTopologyComponent
.
class
);
}
}
}
},
null
,
0
);
},
null
,
0
);
}
catch
(
ComponentNotAvailableException
e
)
{
}
catch
(
ComponentNotAvailableException
e
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment