6 Organism::Organism( int _tp
, int _st
, double _px
, double _py
)
23 int Organism::identify()
28 void Organism::next_state( )
37 double Organism::distance_to( const Organism _o
)
40 (pos_x
- _o
.pos_x
)*(pos_x
- _o
.pos_x
) +
41 (pos_y
-_o
.pos_y
)*(pos_y
- _o
.pos_y
)
46 int Organism::get_proximity( )
51 void Organism::set_proximity( int _prox
)
56 void Organism::add_proximity( int _prox
)
61 void Organism::set_offspring( int _offspring
)
63 next_offspring
= _offspring
;
66 int Organism::get_offspring( )
68 return next_offspring
;
71 double Organism::get_x()
76 double Organism::get_y()
81 int Organism::get_type()
86 int Organism::get_state()
91 void Organism::lifeup()
96 int Organism::get_age()
101 int Organism::set_state( int _st
)
107 void Organism::change_pos( double _nx
, double _ny
)
113 void Organism::eat_food()
118 void Organism::use_food()
126 int Organism::get_food()
131 void Organism::add_pos( double _nx
, double _ny
)
137 void Organism::info( )
139 cout
<<"(x,y) = ("<<pos_x
<<" , "<<pos_y
<<") , state = "<<state
<<endl
;