NaiveNASlib.jl icon indicating copy to clipboard operation
NaiveNASlib.jl copied to clipboard

QoL improvements when declaring strategies

Open DrChainsaw opened this issue 6 years ago • 0 comments

A pattern of chaining strategies like has emerged in this form: ``` PrimaryStrategy(params..., FallBackStrategy1(params..., FallBackStrategy2(params... etc````

While I do like the flexibility this offers functionally, it tends to look like dogbarf in the code which declares it.

Real life horror example:

(RemoveStrategy(CheckAligned(CheckNoSizeCycle(ApplyMutation(SelectOutputs(select = SelectDirection(OutSelect{NaiveNASlib.Exact}(NaiveNASlib.LogSelectionFallback("Reverting...", NoutRevert()))), valuefun = default_neuronselect, align=IncreaseSmaller(DecreaseBigger(AlignSizeBoth(FailAlignSizeWarn()))))), FailAlignSizeWarn(msgfun = (vin,vout) -> "Can not remove vertex $(name(vin))! Size cycle detected!"))))

One small thing which could give a little payoff is to just allowing setting the last fallback strategy (usually either throw error or do nothing).

DrChainsaw avatar Sep 10 '19 18:09 DrChainsaw