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
dc52c049
Commit
dc52c049
authored
Dec 13, 2016
by
Jakob Schöttl
Browse files
Fix class, add comments, rename variables, remove unused code
parent
e45b26cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
VadereGui/src/org/vadere/gui/topographycreator/model/AgentWrapper.java
View file @
dc52c049
...
@@ -21,54 +21,48 @@ import org.vadere.util.geometry.shapes.VShape;
...
@@ -21,54 +21,48 @@ import org.vadere.util.geometry.shapes.VShape;
*
*
*/
*/
public
final
class
AgentWrapper
extends
ScenarioElement
{
public
final
class
AgentWrapper
extends
ScenarioElement
{
/** we only need the radius from the attributes. */
private
final
AttributesAgent
attributes
;
/** the wrapped store object. */
/** the wrapped store object. */
private
Agent
store
;
private
Agent
agent
;
AgentWrapper
(
final
VPoint
position
)
{
AgentWrapper
(
final
VPoint
position
)
{
this
.
attributes
=
new
AttributesAgent
();
// use a Pedestrian as default
this
.
store
=
new
Pedestrian
(
this
.
attributes
,
new
Random
());
// use a Pedestrian as default
// TODO this default does not make much sense
this
.
store
.
setPosition
(
position
);
this
.
agent
=
new
Pedestrian
(
new
AttributesAgent
(),
new
Random
());
this
.
store
.
setTargets
(
new
LinkedList
<
Integer
>());
this
.
agent
.
setPosition
(
position
);
this
.
agent
.
setTargets
(
new
LinkedList
<
Integer
>());
}
}
public
AgentWrapper
(
final
Agent
store
)
{
public
AgentWrapper
(
final
Agent
agent
)
{
this
.
attributes
=
store
.
getAttributes
();
this
.
agent
=
(
Agent
)
agent
.
clone
();
this
.
store
=
store
.
clone
();
}
private
AgentWrapper
(
final
AgentWrapper
wrapper
)
{
this
.
attributes
=
wrapper
.
attributes
;
this
.
store
=
wrapper
.
store
.
clone
();
}
}
public
Agent
getAgentInitialStore
()
{
public
Agent
getAgentInitialStore
()
{
return
store
;
return
agent
;
}
}
public
void
setAgentInitialStore
(
final
Agent
store
)
{
public
void
setAgentInitialStore
(
final
Agent
store
)
{
this
.
store
=
store
;
this
.
agent
=
store
;
}
}
@Override
@Override
public
VShape
getShape
()
{
public
VShape
getShape
()
{
return
store
.
getShape
();
return
agent
.
getShape
();
}
}
@Override
@Override
public
int
getId
()
{
public
int
getId
()
{
return
a
ttributes
.
getId
();
return
a
gent
.
getId
();
}
}
@Override
@Override
public
ScenarioElementType
getType
()
{
public
ScenarioElementType
getType
()
{
// TODO bug - this is a agent wrapper, not necessarily an pedestrian wrapper
return
ScenarioElementType
.
PEDESTRIAN
;
return
ScenarioElementType
.
PEDESTRIAN
;
}
}
@Override
@Override
public
Attributes
getAttributes
()
{
public
Attributes
getAttributes
()
{
return
attributes
;
return
a
gent
.
getA
ttributes
()
;
}
}
}
}
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