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
bab9cc2c
Commit
bab9cc2c
authored
Jul 15, 2020
by
Julian Zobel
Browse files
Minor changes in social group movement
parent
26bd2c12
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/api/linklayer/mac/PhyType.java
View file @
bab9cc2c
...
...
@@ -38,8 +38,9 @@ import de.tudarmstadt.maki.simonstrator.api.component.network.NetworkComponent.N
* @author Bjoern Richerzhagen
* @version 1.0, 25.02.2012
*
* @changes:
* Louis Neumann - setting LORA to "unlimited" bandwith
* @author Julian Zobel
* added LoRa PHY
*
*/
public
enum
PhyType
{
...
...
@@ -95,7 +96,7 @@ public enum PhyType {
* Assuming the following defaults: zero link-layer packet loss, 0.3 kbit/s BW,
* 500us latency, 1kByte MTU
*/
LORA
(
NetInterfaceName
.
LORA
,
0
,
1
*
Rate
.
G
bit_s
,
LORA
(
NetInterfaceName
.
LORA
,
0
,
300
*
Rate
.
bit_s
,
500
*
Time
.
MICROSECOND
,
1024
,
true
);
...
...
src/de/tud/kom/p2psim/api/topology/TopologyComponent.java
View file @
bab9cc2c
...
...
@@ -42,8 +42,9 @@ public interface TopologyComponent extends SimHostComponent,
* Binder-class.
*
* @return
* use Binder.getComponent(Topology.class) instead!
*/
* @deprecated use Binder.getComponent(Topology.class) instead!
*/
@Deprecated
public
Topology
getTopology
();
}
src/de/tud/kom/p2psim/impl/topology/movement/modularosm/SocialGroupMovementModel.java
View file @
bab9cc2c
...
...
@@ -188,6 +188,9 @@ public class SocialGroupMovementModel extends ModularMovementModel {
}
// TODO Move each group
Event
.
scheduleWithDelay
(
timeBetweenMoveOperation
,
this
,
null
,
EVENT_MOVE
);
}
...
...
@@ -243,7 +246,20 @@ public class SocialGroupMovementModel extends ModularMovementModel {
Monitor
.
getOrNull
(
ISocialGroupMovementAnalyzer
.
class
).
onGroupMovesToAttractionPoint
(
group
);
}
doLocalMovement
(
host
,
destination
);
doLocalMovement
(
host
,
destination
);
PositionVector
leaderPos
=
host
.
getRealPosition
();
LinkedHashSet
<
SimLocationActuator
>
groupMembers
=
groupContainer
.
getGroupMembers
(
host
);
groupMembers
.
remove
(
host
);
// remove leader
for
(
SimLocationActuator
groupMember
:
groupMembers
)
{
// Assign small offset to the host depending on the leaders position.
PositionVector
offset
=
new
PositionVector
(
rand
.
nextDouble
()
*
LEADER_GROUP_DISTANCE
,
rand
.
nextDouble
()
*
LEADER_GROUP_DISTANCE
);
PositionVector
newPos
=
leaderPos
.
plus
(
offset
);
// Update location of host, which will be around the leaders location.
groupMember
.
updateCurrentLocation
(
newPos
);
}
}
else
{
// inform analyzer of waiting group
...
...
@@ -252,10 +268,6 @@ public class SocialGroupMovementModel extends ModularMovementModel {
}
}
}
else
{
// while other nodes just follow the group leader
followLeader
(
host
);
}
}
}
...
...
src/de/tud/kom/p2psim/impl/topology/movement/modularosm/groups/SocialMovementGroup.java
View file @
bab9cc2c
...
...
@@ -170,7 +170,7 @@ public class SocialMovementGroup {
}
public
LinkedHashSet
<
SimLocationActuator
>
getMembers
()
{
return
members
;
return
new
LinkedHashSet
<
SimLocationActuator
>(
members
)
;
}
public
void
setMembers
(
LinkedHashSet
<
SimLocationActuator
>
participants
)
{
...
...
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