author Dmitriy Morozov <morozov@cs.duke.edu>
Sun, 17 Feb 2008 09:16:00 -0500
changeset 44 0bf12743641f
parent 43 0f970f454094
child 46 6fbe003aad9d
permissions -rw-r--r--
Started examples/fitness/avida-landscape

 * Author: Dmitriy Morozov
 * Department of Computer Science, Duke University, 2007


#include <string>
#include <vector>

 * Stores organism details stored in a single line of a population detail file in data/ 
 * directory of Avida's output.
class AvidaOrganismDetail
		typedef			int							IDType;
		/// Distance between two genomes
		typedef			unsigned int				DistanceType;
		typedef			unsigned int				CountType;

						AvidaOrganismDetail(std::string line);

		DistanceType 	genome_distance(const AvidaOrganismDetail& other) const;
		IDType			id() const									{ return id_; }
		float			fitness() const								{ return fitness_; }
		CountType		length() const								{ return genome_length_; }
		std::string		genome() const								{ return genome_; }

		IDType			id_, parent_id_;
		int				parent_distance_;
		CountType		num_organisms_alive_, num_organisms_ever_;
		CountType		genome_length_;
		float 			merit_, gestation_time_;
		float 			fitness_;
		int 			update_born_, update_deactivated_, depth_phylogenetic_tree_;
		std::string 	genome_;

 * Stores entire population details (all organisms in a given time step), i.e., stores
 * an entire population detail file in data/ directory of Avida's ouptut.
class AvidaPopulationDetail
		typedef			std::vector<AvidaOrganismDetail>				OrganismVector;
        typedef         OrganismVector::const_iterator                  OrganismIndex;

						AvidaPopulationDetail(std::string filename);

		const OrganismVector& get_organisms() const						{ return organisms_; }

		OrganismVector	organisms_;

#include "avida-population-detail.hpp"