Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are combinators not composable or combineable? #28

Open
abrown7100 opened this issue Oct 17, 2023 · 0 comments
Open

Are combinators not composable or combineable? #28

abrown7100 opened this issue Oct 17, 2023 · 0 comments

Comments

@abrown7100
Copy link

abrown7100 commented Oct 17, 2023

# rust toolchain version
rustup 1.26.0 (5af9b9484 2023-04-05)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.73.0 (cc66ad468 2023-10-03)`

# genevo version from our Cargo.toml
genevo = "0.7.1"

Our simulation setup:

        let mut cvr_sim = simulate(
            genetic_algorithm()
                .with_evaluation(...)
                .with_selection(MaximizeSelector::new(
                    selection_ratio,
                    num_individuals_per_parents,
                ))
                .with_crossover(MultiPointCrossBreeder::new(self.num_crossover_points))
                .with_mutation(RandomValueMutator::new(
                   mutation_rate,
                    mutation_min,
                    mutation_max,
                ))
                .with_reinsertion(ElitistReinserter::new(
                    ...,
                    true,
                    elitism_ratio,
                ))
                .with_initial_population(initial_population)
                .build(),
        )
        .until(or(
            or(
                FitnessLimit::new(highest_possible_fitness()),
                GenerationLimit::new(generation_limit),
            ),
            and(
                FitnessLimit::new(lowest_possible_fitness()),
                GenerationLimit::new(3),
            ),
        ))
        .build();

Specifically referring to the section using or and and inside the until(...). Basically the "sub-OR" was originally the only combinator. We have a section of code where we are using FFI to call into some shared object files to solve complex circuit models (OpenDSS). Inside our fitness function implementation is where we are setting up, exercising, and solving the circuit via the FFI and evaluating the fitness score of the calculations.

Due to this legacy-style setup, I was hoping to use the example I provided here to do either the original combinator (like what's shown in some of the examples), OR if we return the worst possible fitness score AND have 3 generations, then the algorithm simulation would know to stop. FWIW in all of the simulation runs we've done, we have never gotten closer than 90 points to the worst possible score.

Am I misunderstanding or using this incorrectly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant