@@ -40,10 +40,10 @@ using ..MutationFunctionsModule:
4040using .. ConstantOptimizationModule: optimize_constants
4141using .. RecorderModule: @recorder
4242
43- abstract type AbstractMutationResult{N<: AbstractExpression ,P<: PopMember } end
43+ abstract type AbstractMutationResult{N<: AbstractExpression ,P<: AbstractPopMember } end
4444
4545"""
46- MutationResult{N<:AbstractExpression,P<:PopMember }
46+ MutationResult{N<:AbstractExpression,P<:AbstractPopMember }
4747
4848Represents the result of a mutation operation in the genetic programming algorithm. This struct is used to return values from `mutate!` functions.
4949
@@ -160,7 +160,7 @@ Use this to modify how `mutate_constant` changes for an expression type.
160160function condition_mutate_constant! (
161161 :: Type{<:AbstractExpression} ,
162162 weights:: AbstractMutationWeights ,
163- member:: PopMember ,
163+ member:: AbstractPopMember ,
164164 options:: AbstractOptions ,
165165 curmaxsize:: Int ,
166166)
352352
353353@generated function _dispatch_mutations! (
354354 tree:: AbstractExpression ,
355- member:: PopMember ,
355+ member:: AbstractPopMember ,
356356 mutation_choice:: Symbol ,
357357 weights:: W ,
358358 options:: AbstractOptions ;
381381 mutation_weights::AbstractMutationWeights,
382382 options::AbstractOptions;
383383 kws...,
384- ) where {N<:AbstractExpression,P<:PopMember ,S}
384+ ) where {N<:AbstractExpression,P<:AbstractPopMember ,S}
385385
386386Perform a mutation on the given `tree` and `member` using the specified mutation type `S`.
387387Various `kws` are provided to access other data needed for some mutations.
@@ -409,7 +409,7 @@ so it can always return immediately.
409409"""
410410function mutate! (
411411 :: N , :: P , :: Val{S} , :: AbstractMutationWeights , :: AbstractOptions ; kws...
412- ) where {N<: AbstractExpression ,P<: PopMember ,S}
412+ ) where {N<: AbstractExpression ,P<: AbstractPopMember ,S}
413413 return error (" Unknown mutation choice: $S " )
414414end
415415
@@ -422,7 +422,7 @@ function mutate!(
422422 recorder:: RecordType ,
423423 temperature,
424424 kws... ,
425- ) where {N<: AbstractExpression ,P<: PopMember }
425+ ) where {N<: AbstractExpression ,P<: AbstractPopMember }
426426 tree = mutate_constant (tree, temperature, options)
427427 @recorder recorder[" type" ] = " mutate_constant"
428428 return MutationResult {N,P} (; tree= tree)
@@ -436,7 +436,7 @@ function mutate!(
436436 options:: AbstractOptions ;
437437 recorder:: RecordType ,
438438 kws... ,
439- ) where {N<: AbstractExpression ,P<: PopMember }
439+ ) where {N<: AbstractExpression ,P<: AbstractPopMember }
440440 tree = mutate_operator (tree, options)
441441 @recorder recorder[" type" ] = " mutate_operator"
442442 return MutationResult {N,P} (; tree= tree)
@@ -451,7 +451,7 @@ function mutate!(
451451 recorder:: RecordType ,
452452 nfeatures,
453453 kws... ,
454- ) where {N<: AbstractExpression ,P<: PopMember }
454+ ) where {N<: AbstractExpression ,P<: AbstractPopMember }
455455 tree = mutate_feature (tree, nfeatures)
456456 @recorder recorder[" type" ] = " mutate_feature"
457457 return MutationResult {N,P} (; tree= tree)
@@ -465,7 +465,7 @@ function mutate!(
465465 options:: AbstractOptions ;
466466 recorder:: RecordType ,
467467 kws... ,
468- ) where {N<: AbstractExpression ,P<: PopMember }
468+ ) where {N<: AbstractExpression ,P<: AbstractPopMember }
469469 tree = swap_operands (tree)
470470 @recorder recorder[" type" ] = " swap_operands"
471471 return MutationResult {N,P} (; tree= tree)
@@ -480,7 +480,7 @@ function mutate!(
480480 recorder:: RecordType ,
481481 nfeatures,
482482 kws... ,
483- ) where {N<: AbstractExpression ,P<: PopMember }
483+ ) where {N<: AbstractExpression ,P<: AbstractPopMember }
484484 if rand () < 0.5
485485 tree = append_random_op (tree, options, nfeatures)
486486 @recorder recorder[" type" ] = " add_node:append"
@@ -500,7 +500,7 @@ function mutate!(
500500 recorder:: RecordType ,
501501 nfeatures,
502502 kws... ,
503- ) where {N<: AbstractExpression ,P<: PopMember }
503+ ) where {N<: AbstractExpression ,P<: AbstractPopMember }
504504 tree = insert_random_op (tree, options, nfeatures)
505505 @recorder recorder[" type" ] = " insert_node"
506506 return MutationResult {N,P} (; tree= tree)
@@ -514,7 +514,7 @@ function mutate!(
514514 options:: AbstractOptions ;
515515 recorder:: RecordType ,
516516 kws... ,
517- ) where {N<: AbstractExpression ,P<: PopMember }
517+ ) where {N<: AbstractExpression ,P<: AbstractPopMember }
518518 tree = delete_random_op! (tree)
519519 @recorder recorder[" type" ] = " delete_node"
520520 return MutationResult {N,P} (; tree= tree)
@@ -528,7 +528,7 @@ function mutate!(
528528 options:: AbstractOptions ;
529529 recorder:: RecordType ,
530530 kws... ,
531- ) where {N<: AbstractExpression ,P<: PopMember }
531+ ) where {N<: AbstractExpression ,P<: AbstractPopMember }
532532 tree = form_random_connection! (tree)
533533 @recorder recorder[" type" ] = " form_connection"
534534 return MutationResult {N,P} (; tree= tree)
@@ -542,7 +542,7 @@ function mutate!(
542542 options:: AbstractOptions ;
543543 recorder:: RecordType ,
544544 kws... ,
545- ) where {N<: AbstractExpression ,P<: PopMember }
545+ ) where {N<: AbstractExpression ,P<: AbstractPopMember }
546546 tree = break_random_connection! (tree)
547547 @recorder recorder[" type" ] = " break_connection"
548548 return MutationResult {N,P} (; tree= tree)
@@ -556,7 +556,7 @@ function mutate!(
556556 options:: AbstractOptions ;
557557 recorder:: RecordType ,
558558 kws... ,
559- ) where {N<: AbstractExpression ,P<: PopMember }
559+ ) where {N<: AbstractExpression ,P<: AbstractPopMember }
560560 tree = randomly_rotate_tree! (tree)
561561 @recorder recorder[" type" ] = " rotate_tree"
562562 return MutationResult {N,P} (; tree= tree)
@@ -572,7 +572,7 @@ function mutate!(
572572 recorder:: RecordType ,
573573 parent_ref,
574574 kws... ,
575- ) where {N<: AbstractExpression ,P<: PopMember }
575+ ) where {N<: AbstractExpression ,P<: AbstractPopMember }
576576 @assert options. should_simplify
577577 simplify_tree! (tree, options. operators)
578578 tree = combine_operators (tree, options. operators)
@@ -593,7 +593,7 @@ function mutate!(
593593 curmaxsize,
594594 nfeatures,
595595 kws... ,
596- ) where {T,N<: AbstractExpression{T} ,P<: PopMember }
596+ ) where {T,N<: AbstractExpression{T} ,P<: AbstractPopMember }
597597 tree = randomize_tree (tree, curmaxsize, options, nfeatures)
598598 @recorder recorder[" type" ] = " randomize"
599599 return MutationResult {N,P} (; tree= tree)
@@ -608,7 +608,7 @@ function mutate!(
608608 recorder:: RecordType ,
609609 dataset:: Dataset ,
610610 kws... ,
611- ) where {N<: AbstractExpression ,P<: PopMember }
611+ ) where {N<: AbstractExpression ,P<: AbstractPopMember }
612612 cur_member, new_num_evals = optimize_constants (dataset, member, options)
613613 @recorder recorder[" type" ] = " optimize"
614614 return MutationResult {N,P} (;
@@ -625,7 +625,7 @@ function mutate!(
625625 recorder:: RecordType ,
626626 parent_ref,
627627 kws... ,
628- ) where {N<: AbstractExpression ,P<: PopMember }
628+ ) where {N<: AbstractExpression ,P<: AbstractPopMember }
629629 @recorder begin
630630 recorder[" type" ] = " identity"
631631 recorder[" result" ] = " accept"
0 commit comments