-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMacroEnvironment.h
More file actions
69 lines (54 loc) · 1.35 KB
/
MacroEnvironment.h
File metadata and controls
69 lines (54 loc) · 1.35 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
Authors: Andrew Yoder, Thomas Stryjski, Zachary O'Brien
Email: aby7159@rit.edu, tgs9181@rit.edu, zjo5244@rit.edu
Date: 12/3/18
Class: EEEE-346-01
Assignment: Project 3
Purpose: Class for ennvorments on macroscopic scale;
*/
#pragma once
#include "Environment.h"
#include "Animal.h"
#include "Plant.h"
using namespace std;
class MacroEnvironment : public Environment {
private:
double x_max, y_max;
vector<Animal*> animals;
vector<Plant*> plants;
double co2;
double o2;
Sinusoid sunlight;
//Utility functions
//Independent
double fix_x_cord(double x_old);
double fix_y_cord(double y_old);
void spawn_animals(int num);
void spawn_plants(int num);
double get_sunlight(double x, double y);
//Summarizing Functions -> Made to make event() more readable
//Animal Actions
void set_animal_variables();
void animal_eat_move();
void animal_die();
void animal_reproduce();
void animal_age();
//Plant Actions
void set_plant_variables();
void plant_reproduce();
void plant_age();
public:
//constructors
MacroEnvironment();
MacroEnvironment(int t, double min_t, double max_t, double x, double y,int num_animals, int num_plants);
//deconstructors
~MacroEnvironment();
//getters
int animal_pop();
int plant_pop();
//setters
void setBounds(double x, double y);
//others
void event();
void print();
};