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

Fix bugs in genetic operators #53

Merged
merged 8 commits into from
Sep 30, 2023
Merged

Conversation

Timotshak
Copy link
Collaborator

  • Add condition mating_amount > 1 in
    mate_scheduling_order to prevent errors
    on small instances

  • Fix mistake in contractors mutation masking
    in mutate_resources

Timotshak and others added 7 commits September 19, 2023 01:29
 - Update the genetic operators so that they create only valid
   chromosomes. Remove the validity check in the schedule_builder.
   This allows to control the number of schedules created during the
   execution of the genetic algorithm through parameters
   population_size and generation_number. This also increases the
   number of individuals in offspring obtained at each iteration,
   which improves the quality of the genetic algorithm.

 - Introduce combined operators of mutation and crossover. They
   combine operators for order and resources to make them easier
   to use in genetic algorithm

 - Update mutation operators of resources and resource borders by
   replacing the uniform distribution of possible gene mutations to
   improve the stability of chromosome changes

 - Replace loops in genetic operators with numpy operations for time
   improvement on large instances

 - Introduce two-point crossover operator for order. It has higher
   performance on large instances

 - Introduce resource borders updating function. It changes the
   resource borders to the peak values in the schedule obtained from
   the chromosome. This is necessary to track current resource borders
   when optimizing resources

 - Add to resources crossover operator ability to change resource
   borders based on parents. This is necessary to create valid
   chromosomes when optimizing resources

 - Update the schedule_builder and Genetic Algorithm, adding the
   ability to run it in a two-stage mode, which implements
   lexicographic optimization for planning to a deadline.
   This approach is better than integrating the deadline into the
   optimization criterion because it allows one to obtain
   solutions that exactly satisfy the deadline.

 - Introduce new tests for operators, two-stage genetic
   algorithm and resource borders updating function
 - Remove deadline from constructor of Genetic Scheduler

 - Remove rudimentary functionality from fitness
   functions. Evaluate method and evaluator attribute
   are removed

 - Extract generalized function mutate_values for
   resources and resource borders mutation

 - Remove asserts in genetic algorithm

 - Introduce categorical type for individuals. It is
   needed in genetic algorithm
 - Delete try-except blocks

 - Add set_deadline method calling
 - Update logic of fitness functions in genetic
   algorithm. Genetic Scheduler initialisation
   takes constructor of fitness object, that
   creates in each schedule method calling.
   Schedule_builder takes now fitness object

 - Make IndividualType uppercase
 - Add condition mating_amount > 1 in
   mate_scheduling_order to prevent errors
   on small instances

 - Fix mistake in contractors mutation masking
   in mutate_resources
@Timotshak Timotshak added the bug Something isn't working label Sep 29, 2023
@Timotshak Timotshak closed this Sep 29, 2023
@Timotshak Timotshak reopened this Sep 29, 2023
Copy link
Collaborator

@StannisMod StannisMod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@Timotshak Timotshak merged commit ec9a358 into main Sep 30, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants