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
8ddb64ed
Commit
8ddb64ed
authored
Nov 23, 2021
by
Julian Zobel
🦄
Browse files
Corrected logging in SocialGroupMovementModel
parent
05a2918a
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/common/DefaultMonitor.java
View file @
8ddb64ed
...
...
@@ -208,13 +208,11 @@ public class DefaultMonitor implements MonitorComponent, EventHandler,
public
void
close
()
{
if
(
this
.
isMonitoring
&&
analyzers
.
size
()
!=
0
)
{
try
{
output
.
write
(
"*******************************************************\n"
);
output
.
write
(
"# Monitoring results \n"
);
output
.
newLine
();
output
.
write
(
Time
.
getFormattedTime
()
+
": DefaultMonitor closing, stop all analyzers.. \n"
);
for
(
Analyzer
analyzer
:
analyzers
)
{
analyzer
.
stop
(
output
);
}
output
.
write
(
"
*******************************************************
\n"
);
output
.
write
(
"
[DefaultMonitor] Stopped.
\n"
);
output
.
close
();
}
catch
(
IOException
e
)
{
throw
new
AssertionError
();
...
...
src/de/tud/kom/p2psim/impl/topology/component/DefaultTopologyComponent.java
View file @
8ddb64ed
...
...
@@ -32,8 +32,6 @@ import de.tud.kom.p2psim.api.topology.placement.PlacementModel;
import
de.tudarmstadt.maki.simonstrator.api.Randoms
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.IAttractionPoint
;
/**
* Default implementation of a {@link TopologyComponent}.
*
...
...
@@ -100,18 +98,16 @@ public class DefaultTopologyComponent extends AbstractTopologyComponent {
@Override
public
double
getMovementSpeed
()
{
try
{
if
(
currentMovementSpeed
==
-
1
)
{
this
.
currentMovementSpeed
=
movementModel
.
getMovementSpeedDistribution
().
calculateSpeed
();
}
this
.
currentMovementSpeed
=
movementModel
.
getMovementSpeedDistribution
().
calculateSpeed
();
}
}
catch
(
UnsupportedOperationException
e
)
{
if
(
currentMovementSpeed
==
-
1
)
{
calcRandomMovementSpeed
();
}
calcRandomMovementSpeed
();
}
return
this
.
currentMovementSpeed
;
}
...
...
@@ -135,8 +131,7 @@ public class DefaultTopologyComponent extends AbstractTopologyComponent {
public
Set
<
IAttractionPoint
>
getAllAttractionPoints
()
{
return
movementModel
.
getAllAttractionPoints
();
}
public
static
class
Factory
implements
TopologyComponentFactory
{
@Override
...
...
src/de/tud/kom/p2psim/impl/topology/movement/local/AbstractLocalMovementStrategy.java
View file @
8ddb64ed
...
...
@@ -40,9 +40,6 @@ public abstract class AbstractLocalMovementStrategy implements
private
double
scaleFactor
=
1
;
public
double
getMovementSpeed
(
SimLocationActuator
ms
)
{
/*
* FIXME BR: why exactly is only the maxSpeed considered here?
*/
return
ms
.
getMovementSpeed
()
*
scaleFactor
;
}
...
...
src/de/tud/kom/p2psim/impl/topology/movement/modularosm/SocialGroupMovementModel.java
View file @
8ddb64ed
...
...
@@ -39,6 +39,7 @@ import de.tudarmstadt.maki.simonstrator.api.Binder;
import
de.tudarmstadt.maki.simonstrator.api.Event
;
import
de.tudarmstadt.maki.simonstrator.api.Monitor
;
import
de.tudarmstadt.maki.simonstrator.api.Time
;
import
de.tudarmstadt.maki.simonstrator.api.Monitor.Level
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.IAttractionPoint
;
/**
...
...
@@ -227,8 +228,8 @@ public class SocialGroupMovementModel extends ModularMovementModel {
if
(
either
.
hasLeft
())
{
ms
.
updateCurrentLocation
(
either
.
getLeft
());
if
(!
checkBoundaries
(
ms
.
getRealPosition
()))
{
System
.
err
.
println
(
"Social Group Movement Model: Host
moved outside of simulated area!
"
);
if
(!
checkBoundaries
(
ms
.
getRealPosition
()))
{
Monitor
.
log
(
getClass
(),
Level
.
WARN
,
"Host "
+
ms
.
getHost
().
toString
()
+
"
moved outside of simulated area!
Desination: "
+
destination
,
ms
);
}
}
else
{
...
...
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