Exemple #1
0
func main() {
	flag.Parse()
	//defer profile.Start(profile.CPUProfile).Stop()

	if *Phased {
		fmt.Println("Using phased mutator")
	} else {
		fmt.Println("Using complexifying-only mutator")
	}
	fmt.Println("Each trial will run for a maximum of", *Duration, "minutes.")

	if err := trials.Run(func(i int) (*neat.Experiment, error) {
		eval := &Evaluator{stopTime: time.Now().Add(time.Minute * time.Duration(*Duration))}
		var ctx *starter.Context
		if *Phased {
			ctx = starter.NewContext(eval, func(ctx *starter.Context) {
				ctx.SetMutator(mutator.NewComplete(ctx, ctx, ctx, ctx, ctx, ctx))
			})
		} else {
			ctx = starter.NewContext(eval)
		}
		if exp, err := starter.NewExperiment(ctx, ctx, i); err != nil {
			return nil, err
		} else {
			return exp, nil
		}

	}); err != nil {
		log.Fatal("Could not run OCR: ", err)
	}
}