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
08833c9c
Commit
08833c9c
authored
Mar 27, 2015
by
Thomas Pitiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
up
parent
900ad261
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
include/agent.h
include/agent.h
+1
-1
src/agent.cpp
src/agent.cpp
+8
-9
src/simulator.cpp
src/simulator.cpp
+1
-0
No files found.
include/agent.h
View file @
08833c9c
...
...
@@ -15,7 +15,7 @@ public:
Agent
(
Simulator
*
sim
,
VEC3
startingPoint
,
std
::
vector
<
VEC3
>
goals
);
Agent
(
Simulator
*
sim
,
VEC3
startingPoint
,
std
::
vector
<
VEC3
>
goals
,
Dart
d
)
;
~
Agent
();
void
init
(
VEC3
startingPoint
,
std
::
vector
<
VEC3
>
goals
,
Dart
d
);
void
init
(
Simulator
*
sim
,
VEC3
startingPoint
,
std
::
vector
<
VEC3
>
goals
,
Dart
d
);
void
updatePosition
();
...
...
src/agent.cpp
View file @
08833c9c
#include "simulator.h"
// initialisation Agent
void
Agent
::
init
(
VEC3
startingPoint
,
std
::
vector
<
VEC3
>
goals
,
Dart
d
)
void
Agent
::
init
(
Simulator
*
sim
,
VEC3
startingPoint
,
std
::
vector
<
VEC3
>
goals
,
Dart
d
)
{
sim_
=
sim
;
goals_
=
goals
;
r
=
0.0
f
;
g
=
0.0
f
;
...
...
@@ -16,21 +17,19 @@ void Agent::init(VEC3 startingPoint,std::vector<VEC3> goals,Dart d)
maxVelocity_
=
3.0
f
;
//lien simulateur
agentNo
=
sim_
->
agents
.
size
()
;
Simulator
*
sim_
;
alive
=
true
;
sim_
->
agents
.
push_back
(
this
);
}
Agent
::
Agent
(
Simulator
*
sim
,
VEC3
startingPoint
,
std
::
vector
<
VEC3
>
goals
,
Dart
d
)
:
sim_
(
sim
)
Agent
::
Agent
(
Simulator
*
sim
,
VEC3
startingPoint
,
std
::
vector
<
VEC3
>
goals
,
Dart
d
)
{
init
(
startingPoint
,
goals
,
d
);
init
(
s
im
,
s
tartingPoint
,
goals
,
d
);
}
Agent
::
Agent
(
Simulator
*
sim
,
VEC3
startingPoint
,
std
::
vector
<
VEC3
>
goals
)
:
sim_
(
sim
)
Agent
::
Agent
(
Simulator
*
sim
,
VEC3
startingPoint
,
std
::
vector
<
VEC3
>
goals
)
{
Dart
d
=
sim
_
->
envMap_
.
getBelongingCell
(
startingPoint
);
init
(
startingPoint
,
goals
,
d
);
Dart
d
=
sim
->
envMap_
.
getBelongingCell
(
startingPoint
);
init
(
s
im
,
s
tartingPoint
,
goals
,
d
);
}
void
Agent
::
updatePosition
()
...
...
src/simulator.cpp
View file @
08833c9c
...
...
@@ -84,6 +84,7 @@ void Simulator::initAgents(int nbAgents)
goals
.
push_back
(
goal
);
goals
.
push_back
(
start
);
Agent
*
ag
=
new
Agent
(
this
,
start
,
goals
);
CGoGNout
<<
"agent initialisé : "
<<
ag
->
agentNo
<<
CGoGNendl
;
// CGoGNout<<"agent n°" << agents_[i]->agentNo << " : "<< agents_[i]<<CGoGNendl;
}
}
...
...
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