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
5f9bb1f0
Commit
5f9bb1f0
authored
Oct 06, 2017
by
Björn Richerzhagen
Browse files
Removed SCALING and 25px PAINT_OFFSET causing headaches ;)
parent
2d56973c
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/movement/RSUMovementModel.java
View file @
5f9bb1f0
...
...
@@ -157,7 +157,7 @@ public class RSUMovementModel implements MovementModel, FutureLocationSensor {
if
(
_currentIndex
<
_intersections
.
size
())
{
// Initial placement
Position
intersection
=
_intersections
.
get
(
_currentIndex
);
actuator
.
updateCurrentLocation
(
new
PositionVector
(
intersection
.
getX
()
/
VehicleMovementModel
.
SCALING_FACTOR
,
intersection
.
getY
()
/
VehicleMovementModel
.
SCALING_FACTOR
));
actuator
.
updateCurrentLocation
(
new
PositionVector
(
intersection
.
getX
()
,
intersection
.
getY
()
));
hostIntersectionMatching
.
put
(
actuator
.
getHost
().
getId
(),
_currentIndex
);
...
...
src/de/tud/kom/p2psim/impl/topology/movement/VehicleMovementModel.java
View file @
5f9bb1f0
...
...
@@ -61,10 +61,6 @@ public class VehicleMovementModel implements MovementModel, EventHandler, Future
private
static
VehicleMovementModel
MOVEMENT
;
public
static
final
double
SCALING_FACTOR
=
1.0
;
private
static
final
double
PAINT_OFFSET
=
25
;
private
long
timeBetweenMoveOperations
;
private
final
List
<
SimLocationActuator
>
components
;
...
...
@@ -300,13 +296,13 @@ public class VehicleMovementModel implements MovementModel, EventHandler, Future
SimLocationActuator
component
=
requestSimActuator
(
vehicle
);
if
(
scenarioHeight
!=
-
1
)
{
component
.
updateCurrentLocation
(
new
PositionVector
(
position
.
getX
()
/
SCALING_FACTOR
+
PAINT_OFFSET
,
Math
.
min
(
scenarioHeight
,
height
)
-
position
.
getY
()
/
SCALING_FACTOR
+
PAINT_OFFSET
));
component
.
updateCurrentLocation
(
new
PositionVector
(
position
.
getX
(),
Math
.
min
(
scenarioHeight
,
height
)
-
position
.
getY
()));
}
else
{
// This would be vertically mirrored
component
.
updateCurrentLocation
(
new
PositionVector
(
position
.
getX
()
/
SCALING_FACTOR
+
PAINT_OFFSET
,
position
.
getY
()
/
SCALING_FACTOR
+
PAINT_OFFSET
));
component
.
updateCurrentLocation
(
new
PositionVector
(
position
.
getX
()
,
position
.
getY
()
));
}
component
.
setMovementSpeed
(
position
.
getSpeed
()
/
SCALING_FACTOR
);
component
.
setMovementSpeed
(
position
.
getSpeed
());
try
{
RoutedNetLayer
routedNetLayer
=
component
.
getHost
().
getComponent
(
RoutedNetLayer
.
class
);
...
...
src/de/tud/kom/p2psim/impl/topology/placement/RSUPlacement.java
View file @
5f9bb1f0
...
...
@@ -109,7 +109,7 @@ public class RSUPlacement implements PlacementModel {
if
(
_currentIndex
<
_intersections
.
size
())
{
Position
intersection
=
_intersections
.
get
(
_currentIndex
);
_currentIndex
++;
return
new
PositionVector
(
intersection
.
getX
()
/
VehicleMovementModel
.
SCALING_FACTOR
,
intersection
.
getY
()
/
VehicleMovementModel
.
SCALING_FACTOR
);
return
new
PositionVector
(
intersection
.
getX
()
,
intersection
.
getY
()
);
}
else
{
return
new
PositionVector
(
Double
.
NaN
,
Double
.
NaN
);
}
...
...
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