math-optim/algo/ga/error.go
leo 74109521b0
All checks were successful
continuous-integration/drone/push Build is passing
ga: implement SOMA T3A algorithm
2023-02-21 23:51:52 +01:00

29 lines
833 B
Go

// Copyright 2023 wanderer <a_mirre at utb dot cz>
// SPDX-License-Identifier: GPL-3.0-or-later
package ga
type gaError struct {
s string
}
var (
errGenerationsIsZero = newGAError("Generations cannot be 0")
errBenchMinItersIsLTOne = newGAError("Minimum bench iterations cannot be less than 1")
errNPIsZero = newGAError("NP cannot be 0")
errKIsZero = newGAError("K cannot be 0")
errMIsZero = newGAError("M cannot be 0")
errNIsZero = newGAError("N cannot be 0")
errNjumpsIsZero = newGAError("Njumps cannot be 0")
errDimensionsUnset = newGAError("Dimensions cannot be unset")
errBenchUnset = newGAError("Bench cannot be unset")
)
func (e *gaError) Error() string {
return e.s
}
func newGAError(text string) error {
return &gaError{s: text}
}