-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpredator.h
38 lines (24 loc) · 1.98 KB
/
predator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
Flockuda: A numerical model of predator-prey dynamics based on the Molecular Dynamics approach of Lee et al. (2006).
Copyright (C) 2019 Christian T. Jacobs
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <H5Part.h>
#include "configuration.h"
class Predator
{
public:
float x[2]; // Location of the predator in two-dimensional space.
float xold[2]; // Location of the predator in two-dimensional space at the previous timestep.
float v[2]; // Velocity of the predator.
float vold[2]; // Velocity of the predator at the previous timestep.
__host__ void initialise(float x0, float x1, float v0, float v1);
__host__ void save();
};
__host__ void initialise_predator(Predator *p, Configuration config);
__host__ void write_predator(H5PartFile *output, Predator *p, int it);
__host__ void save_predator(Predator *p);
__host__ void predator_velocity(Predator *p, Configuration config, float *c, float *xrandom);
__host__ void predator_location(Predator *p, Configuration config);