ciren / cilib

Typesafe, purely functional Computational Intelligence
https://cilib.net
Apache License 2.0
124 stars 101 forks source link

Discriminate between evaluated and unevaluated entity collections #298

Closed gpampara closed 6 years ago

gpampara commented 6 years ago

Algorithm various such the best strategy for the DE require that the entity collection be pre-evaluated. This is required to make sure that the various fitness comparisons succeed.

This kind of usage needs to, however, raise a compiler error and not fail at runtime.

A first thought would be to change the signature of the algorithms, from:

NonEmptyList[Entity[S,A]] => Entity[S, A] => Step[B, Entity[S, A]]

to something like:

Collection[Entity[S, A], X] => Entity[S, A] => Step[B, Entity[S, A]]

Where X could be a phantom type that tracks the evaluation status of the collection? There is no definitive solution right now, but this issue is to track the problem so that we don't forget about this potential issue.

gpampara commented 6 years ago

After some discussion, this doesn't seem to really be an issue as the uninitialized state for the initial iteration simply means a more diverse starting point for the optimization process and therefore, not necessarily a bad thing.

As a result of this observation, I'm closing this issue.