Skip to content
Snippets Groups Projects
Commit f4148a0d authored by Bernhard Johannes Berger's avatar Bernhard Johannes Berger
Browse files

Minor fixes.

parent cf2ead18
No related branches found
No related tags found
No related merge requests found
Pipeline #240717 passed
......@@ -41,8 +41,8 @@ public class WeightedSumFitnessValue implements FitnessValue {
double otherFitness = 0.0;
for(int index = 0; index < fitnessValues.length; ++index) {
ownFitness = ownFitness - this.normalizedWeights[index] * Math.abs(this.fitnessValues[index]);
otherFitness = otherFitness - this.normalizedWeights[index] * Math.abs(((WeightedSumFitnessValue)other).getFitnessValues()[index]);
ownFitness = ownFitness + this.normalizedWeights[index] * Math.abs(this.fitnessValues[index]);
otherFitness = otherFitness + this.normalizedWeights[index] * Math.abs(((WeightedSumFitnessValue)other).getFitnessValues()[index]);
}
return ownFitness == otherFitness ? 0 : (int)Math.signum(ownFitness - otherFitness);
......
......@@ -106,8 +106,6 @@ public class HeuristicSearch {
public void run() {
setup();
final Factory<Genotype<?>> gtf = encoding.encoding();
final Constraint<?, FitnessValue> constraint = new ConstraintList(constraints.get());
final Engine<?, FitnessValue> engine= Engine.builder(this.fitnessFunction, encoding)
......
......@@ -35,7 +35,7 @@ public class IndividualStatistics implements StatisticsWriter {
@Inject
private CustomCodec encoding;
@Inject @Named("surrogate-source-properties-specification")
@Inject @Named("genotype-specification")
private PropertiesSpecification sourceSpecification;
@Inject
......
package de.evoal.surrogate.main.ea;
import de.evoal.core.api.board.Blackboard;
import de.evoal.core.api.board.BlackboardEntry;
import de.evoal.core.api.properties.PropertiesSpecification;
import de.evoal.core.api.properties.stream.FileBasedPropertiesStreamSupplier;
import de.evoal.surrogate.api.SurrogateBlackboardEntry;
import de.evoal.surrogate.api.training.TrainingDataManager;
import lombok.extern.slf4j.Slf4j;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.event.Observes;
import java.io.File;
@ApplicationScoped
@Slf4j
public class TrainingDataProducer {
/*
public void setTrainingData(final @Observes BlackboardEntry event, final Blackboard board, final TrainingDataManager manager) {
if (!event.isSame(SurrogateBlackboardEntry.SURROGATE_TRAINING_DATA_FILE)) {
return;
}
final String filename = board.get(SurrogateBlackboardEntry.SURROGATE_TRAINING_DATA_FILE);
final File trainingFile = new File(filename);
log.info("Using training data from {}.", filename);
// TODO FIXME PROPERTIES
manager.setTrainingStream(new FileBasedPropertiesStreamSupplier(trainingFile, PropertiesSpecification.builder().build()));
}
*/
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment