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
c8937d62
Commit
c8937d62
authored
Aug 25, 2020
by
Julian Zobel
Browse files
minor changes
parent
f9b5d672
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/util/PositionVector.java
View file @
c8937d62
...
...
@@ -72,8 +72,9 @@ public class PositionVector implements Location {
private
double
[]
values
;
private
double
accuracy
=
-
1
;
/**
* Timestamp
with time when
creat
ed
* Timestamp
of
creat
ion
*/
private
long
created
;
...
...
@@ -106,9 +107,7 @@ public class PositionVector implements Location {
this
(
vec
.
getDimensions
());
for
(
int
i
=
0
;
i
<
vec
.
getDimensions
();
i
++)
{
setEntry
(
i
,
vec
.
getEntry
(
i
));
}
this
.
created
=
Time
.
getCurrentTime
();
}
}
public
PositionVector
(
double
longitudeOrX
,
double
latitudeOrY
)
{
...
...
@@ -116,7 +115,6 @@ public class PositionVector implements Location {
this
.
setLatitudeOrY
(
latitudeOrY
);
this
.
setLongitudeOrX
(
longitudeOrX
);
this
.
setAltitude
(
0
);
this
.
created
=
Time
.
getCurrentTime
();
}
public
PositionVector
(
double
longitudeOrX
,
double
latitudeOrY
,
double
altitude
)
{
...
...
@@ -124,7 +122,6 @@ public class PositionVector implements Location {
this
.
setLatitudeOrY
(
latitudeOrY
);
this
.
setLongitudeOrX
(
longitudeOrX
);
this
.
setAltitude
(
altitude
);
this
.
created
=
Time
.
getCurrentTime
();
}
public
PositionVector
(
Location
location
)
{
...
...
@@ -154,7 +151,6 @@ public class PositionVector implements Location {
for
(
int
i
=
0
;
i
<
values
.
length
;
i
++)
{
setEntry
(
i
,
values
[
i
]);
}
this
.
created
=
Time
.
getCurrentTime
();
}
@Override
...
...
@@ -163,7 +159,7 @@ public class PositionVector implements Location {
* If you extend Position Vector, make sure to overwrite this method!
*/
PositionVector
clone
=
new
PositionVector
(
this
);
// use clone constructor
clone
.
setTimestamp
(
this
.
created
)
;
clone
.
created
=
this
.
created
;
return
clone
;
}
...
...
@@ -559,11 +555,7 @@ public class PositionVector implements Location {
public
long
getAgeOfLocation
()
{
return
Time
.
getCurrentTime
()
-
created
;
}
private
void
setTimestamp
(
long
locationTimestamp
)
{
this
.
created
=
locationTimestamp
;
}
@Override
public
double
distanceTo
(
Location
dest
)
{
if
(
dest
instanceof
PositionVector
)
{
...
...
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