package Evo::Immune::Population;

use parent 'Evo::GA::Population';

sub new {
	my ($class) = @_;

	my $self = $class->SUPER::new;
}

sub fittest {
	my ($self) = @_;
	my $fitness = 0.0;

	my $metafunction = Evo::Immune::MetaFunction->new(&fitness_M0);

	for (my $i = 0; $i < scalar $self->{population}; $i++) {
		my $idx1 = 0;
		my $idx2 = scalar $self->{population}[0]->{genes}; ### FIXME choice of antigens
		my @args = ();
		push (@args, $idx1);
		push (@args, $idx2);

		$fitness += $metafunction->do($self, @args);
	}

	return $fitness;
}

1;
