Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
V
vadere
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
110
Issues
110
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
3
Merge Requests
3
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vadere
vadere
Commits
dc52c049
Commit
dc52c049
authored
Dec 13, 2016
by
Jakob Schöttl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix class, add comments, rename variables, remove unused code
parent
e45b26cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
20 deletions
+14
-20
VadereGui/src/org/vadere/gui/topographycreator/model/AgentWrapper.java
.../org/vadere/gui/topographycreator/model/AgentWrapper.java
+14
-20
No files found.
VadereGui/src/org/vadere/gui/topographycreator/model/AgentWrapper.java
View file @
dc52c049
...
...
@@ -21,54 +21,48 @@ import org.vadere.util.geometry.shapes.VShape;
*
*/
public
final
class
AgentWrapper
extends
ScenarioElement
{
/** we only need the radius from the attributes. */
private
final
AttributesAgent
attributes
;
/** the wrapped store object. */
private
Agent
store
;
private
Agent
agent
;
AgentWrapper
(
final
VPoint
position
)
{
this
.
attributes
=
new
AttributesAgent
();
this
.
store
=
new
Pedestrian
(
this
.
attributes
,
new
Random
());
// use a Pedestrian as default
this
.
store
.
setPosition
(
position
);
this
.
store
.
setTargets
(
new
LinkedList
<
Integer
>());
// use a Pedestrian as default
// TODO this default does not make much sense
this
.
agent
=
new
Pedestrian
(
new
AttributesAgent
(),
new
Random
());
this
.
agent
.
setPosition
(
position
);
this
.
agent
.
setTargets
(
new
LinkedList
<
Integer
>());
}
public
AgentWrapper
(
final
Agent
store
)
{
this
.
attributes
=
store
.
getAttributes
();
this
.
store
=
store
.
clone
();
}
private
AgentWrapper
(
final
AgentWrapper
wrapper
)
{
this
.
attributes
=
wrapper
.
attributes
;
this
.
store
=
wrapper
.
store
.
clone
();
public
AgentWrapper
(
final
Agent
agent
)
{
this
.
agent
=
(
Agent
)
agent
.
clone
();
}
public
Agent
getAgentInitialStore
()
{
return
store
;
return
agent
;
}
public
void
setAgentInitialStore
(
final
Agent
store
)
{
this
.
store
=
store
;
this
.
agent
=
store
;
}
@Override
public
VShape
getShape
()
{
return
store
.
getShape
();
return
agent
.
getShape
();
}
@Override
public
int
getId
()
{
return
a
ttributes
.
getId
();
return
a
gent
.
getId
();
}
@Override
public
ScenarioElementType
getType
()
{
// TODO bug - this is a agent wrapper, not necessarily an pedestrian wrapper
return
ScenarioElementType
.
PEDESTRIAN
;
}
@Override
public
Attributes
getAttributes
()
{
return
a
ttributes
;
return
a
gent
.
getAttributes
()
;
}
}
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