All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cilib.Entity.scala Maven / Gradle / Ivy

There is a newer version: 2.0.1-30-g5ca4090
Show newest version
package cilib

final case class Entity[S, A](state: S, pos: Position[A])

object Entity {

  implicit def entityEqual[S, A: scalaz.Equal]: scalaz.Equal[Entity[S, A]] =
    new scalaz.Equal[Entity[S, A]] {
      import Position._
      def equal(x: Entity[S, A], y: Entity[S, A]): Boolean =
        scalaz.Equal[Position[A]].equal(x.pos, y.pos)
    }

  implicit def entityFitness[S, A]: Fitness[Entity[S, ?], A] =
    new Fitness[Entity[S, ?], A] {
      def fitness(a: Entity[S, A]) =
        a.pos.objective
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy