Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
boids
boids4
Commits
d2006f7b
Commit
d2006f7b
authored
Oct 23, 2015
by
Cassio Kirch
Browse files
Gamma != 0 for isolated cells
parent
864ff4b3
Changes
1
Show whitespace changes
Inline
Side-by-side
main.c
View file @
d2006f7b
...
...
@@ -19,6 +19,7 @@ getGamma (const struct Boid* const boids)
do
{
boidCount
--
;
if
(
boids
[
boidCount
].
gamma
<=
1
.
01
)
gamma
+=
boids
[
boidCount
].
gamma
/
endoBoids
;
}
while
(
boidCount
!=
0
);
...
...
@@ -33,14 +34,16 @@ one_system ()
struct
Box
box
[
BOXES
];
unsigned
int
boidCount
,
boxID
,
threadCount
;
unsigned
long
long
int
step
,
continuousStep
=
0
;
FILE
*
dat
=
initializeSingleFile
();
//
FILE* dat = initializeSingleFile();
FILE
*
finalConfigurationFile
;
char
finalConfigurationFileName
[
FILENAME_SIZE
];
#ifdef PLOT_EXIT_FILES
FILE
*
endoFile
;
FILE
*
ectoFile
;
#endif
#ifdef GAMMA_FILE
FILE
*
gammaFile
=
initializeGammaFile
();
#endif
/* Set the pthread_create parameters. */
struct
Parameters
parametersStruct
[
NUM_THREADS
];
...
...
@@ -65,10 +68,11 @@ one_system ()
initializeBoid
(
&
boid
[
boidCount
]);
checkLimits
(
&
(
boid
[
boidCount
]));
}
initializeBoxes
(
box
);
initializeBoxes
(
box
);
for
(
boidCount
=
0
;
boidCount
<
N
;
boidCount
++
)
appendBoid
(
&
(
boid
[
boidCount
]),
box
);
for
(
step
=
0
;
step
<
STEPS
;
++
step
)
{
nextStep
(
parameters
);
...
...
@@ -110,12 +114,17 @@ one_system ()
fclose
(
endoFile
);
fclose
(
ectoFile
);
#endif
#ifdef GAMMA_FILE
fprintf
(
gammaFile
,
"%llu
\t
%lf
\n
"
,
step
,
getGamma
(
boid
));
#endif
++
continuousStep
;
}
}
#ifdef GAMMA_FILE
fclose
(
gammaFile
);
fclose
(
dat
);
#endif
//fclose (dat);
sprintf
(
finalConfigurationFileName
,
"final_%s.dat"
,
getDate
());
finalConfigurationFile
=
fopen
(
finalConfigurationFileName
,
"w"
);
for
(
boidCount
=
0
;
boidCount
<
N
;
boidCount
++
)
...
...
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