Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SocialAgents3D
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Pitiot
SocialAgents3D
Commits
23ffe43f
Commit
23ffe43f
authored
May 29, 2013
by
Arash HABIBI
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scenario3 grand rayon
parent
6ea115fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
include/agent.h
include/agent.h
+3
-1
src/agent.cpp
src/agent.cpp
+4
-4
No files found.
include/agent.h
View file @
23ffe43f
...
...
@@ -12,6 +12,8 @@
//#define EXPORTING_AGENT
#define EXPORTING_OBJ
#define SMOOTHING_BUFFER_SIZE 200
#ifdef SECURED
#include "Algo/MovingObjects/particle_cell_2D_secured.h"
...
...
@@ -156,7 +158,7 @@ public:
VEC3
velocity_
;
VEC3
newVelocity_
;
VEC3
prefVelocity_
;
VEC3
meanVelocity_
[
50
]
;
VEC3
meanVelocity_
[
SMOOTHING_BUFFER_SIZE
]
;
VEC3
meanDirection_
;
Simulator
*
sim_
;
...
...
src/agent.cpp
View file @
23ffe43f
...
...
@@ -123,7 +123,7 @@ void Agent::init(const VEC3& start, const VEC3& goal)
// color1=0;
// color2 = 1.0f;
// }
for
(
unsigned
int
i
=
0
;
i
<
4
;
++
i
)
for
(
unsigned
int
i
=
0
;
i
<
SMOOTHING_BUFFER_SIZE
;
++
i
)
meanVelocity_
[
i
].
set
(
0
)
;
agentNeighbors_
.
reserve
(
maxNeighbors_
*
2
)
;
...
...
@@ -505,11 +505,11 @@ void Agent::update()
#endif
meanDirection_
.
set
(
0
)
;
for
(
unsigned
int
i
=
0
;
i
<
50
;
++
i
)
{
for
(
unsigned
int
i
=
0
;
i
<
SMOOTHING_BUFFER_SIZE
;
++
i
)
{
meanDirection_
+=
meanVelocity_
[
i
]
;
meanVelocity_
[
i
]
=
meanVelocity_
[(
i
+
1
)
%
50
]
;
meanVelocity_
[
i
]
=
meanVelocity_
[(
i
+
1
)
%
SMOOTHING_BUFFER_SIZE
]
;
}
meanVelocity_
[
49
]
=
velocity_
;
meanVelocity_
[
SMOOTHING_BUFFER_SIZE
-
1
]
=
velocity_
;
meanDirection_
.
normalize
()
;
}
...
...
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