Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
vadere
vadere
Commits
640cf23c
Commit
640cf23c
authored
Dec 06, 2018
by
Stefan Schuhbaeck
Browse files
remove quick fix and add move call to ODEModel
parent
98db5d98
Changes
4
Show whitespace changes
Inline
Side-by-side
VadereSimulator/src/org/vadere/simulator/control/Simulation.java
View file @
640cf23c
...
@@ -295,7 +295,6 @@ public class Simulation {
...
@@ -295,7 +295,6 @@ public class Simulation {
for
(
Model
m
:
models
)
{
for
(
Model
m
:
models
)
{
m
.
update
(
simTimeInSec
);
m
.
update
(
simTimeInSec
);
}
}
topographyController
.
update
(
simTimeInSec
);
//rebuild CellGrid
if
(
topographyController
.
getTopography
().
hasTeleporter
())
{
if
(
topographyController
.
getTopography
().
hasTeleporter
())
{
teleporterController
.
update
(
simTimeInSec
);
teleporterController
.
update
(
simTimeInSec
);
...
...
VadereSimulator/src/org/vadere/simulator/models/ode/ODEModel.java
View file @
640cf23c
...
@@ -179,7 +179,10 @@ public abstract class ODEModel<T extends DynamicElement, TAttributes extends Att
...
@@ -179,7 +179,10 @@ public abstract class ODEModel<T extends DynamicElement, TAttributes extends Att
equations
.
getVelocity
(
counter
,
y
,
newVelocity
);
equations
.
getVelocity
(
counter
,
y
,
newVelocity
);
// set data to ped
// set data to ped
VPoint
oldPosition
=
element
.
getPosition
();
setPosition
(
element
,
newPos
);
setPosition
(
element
,
newPos
);
topography
.
moveElement
(
element
,
oldPosition
);
setVelocity
(
element
,
new
Vector2D
(
newVelocity
[
0
],
newVelocity
[
1
]));
setVelocity
(
element
,
new
Vector2D
(
newVelocity
[
0
],
newVelocity
[
1
]));
counter
++;
counter
++;
}
}
...
...
VadereState/src/org/vadere/state/scenario/DynamicElementMover.java
0 → 100644
View file @
640cf23c
package
org.vadere.state.scenario
;
import
org.vadere.util.geometry.shapes.VPoint
;
public
interface
DynamicElementMover
{
/**
* @param element the DynamicElement which was moved to a new position
* @param oldPosition the old potion the DynamicElement was prior to this call. (The new position is contained in the element)
*/
<
T
extends
DynamicElement
>
void
moveElement
(
T
element
,
final
VPoint
oldPosition
);
<
T
extends
DynamicElement
>
void
addElement
(
T
element
);
<
T
extends
DynamicElement
>
void
removeElement
(
T
element
);
}
VadereState/src/org/vadere/state/scenario/Topography.java
View file @
640cf23c
...
@@ -30,7 +30,7 @@ import org.vadere.util.geometry.shapes.VPolygon;
...
@@ -30,7 +30,7 @@ import org.vadere.util.geometry.shapes.VPolygon;
import
org.vadere.util.geometry.shapes.VShape
;
import
org.vadere.util.geometry.shapes.VShape
;
@JsonIgnoreProperties
(
value
=
{
"allOtherAttributes"
,
"obstacleDistanceFunction"
})
@JsonIgnoreProperties
(
value
=
{
"allOtherAttributes"
,
"obstacleDistanceFunction"
})
public
class
Topography
{
public
class
Topography
implements
DynamicElementMover
{
/** Transient to prevent JSON serialization. */
/** Transient to prevent JSON serialization. */
private
static
Logger
logger
=
Logger
.
getLogger
(
Topography
.
class
);
private
static
Logger
logger
=
Logger
.
getLogger
(
Topography
.
class
);
...
@@ -216,14 +216,17 @@ public class Topography {
...
@@ -216,14 +216,17 @@ public class Topography {
return
getContainer
(
elementType
).
getElement
(
id
);
return
getContainer
(
elementType
).
getElement
(
id
);
}
}
@Override
public
<
T
extends
DynamicElement
>
void
addElement
(
T
element
)
{
public
<
T
extends
DynamicElement
>
void
addElement
(
T
element
)
{
((
DynamicElementContainer
<
T
>)
getContainer
(
element
.
getClass
())).
addElement
(
element
);
((
DynamicElementContainer
<
T
>)
getContainer
(
element
.
getClass
())).
addElement
(
element
);
}
}
@Override
public
<
T
extends
DynamicElement
>
void
removeElement
(
T
element
)
{
public
<
T
extends
DynamicElement
>
void
removeElement
(
T
element
)
{
((
DynamicElementContainer
<
T
>)
getContainer
(
element
.
getClass
())).
removeElement
(
element
);
((
DynamicElementContainer
<
T
>)
getContainer
(
element
.
getClass
())).
removeElement
(
element
);
}
}
@Override
public
<
T
extends
DynamicElement
>
void
moveElement
(
T
element
,
final
VPoint
oldPosition
)
{
public
<
T
extends
DynamicElement
>
void
moveElement
(
T
element
,
final
VPoint
oldPosition
)
{
((
DynamicElementContainer
<
T
>)
getContainer
(
element
.
getClass
())).
moveElement
(
element
,
oldPosition
);
((
DynamicElementContainer
<
T
>)
getContainer
(
element
.
getClass
())).
moveElement
(
element
,
oldPosition
);
}
}
...
...
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