mirror of
https://github.com/mudler/luet.git
synced 2025-08-29 12:13:09 +00:00
Add compact string notation for SolverOptions
This commit is contained in:
parent
b2a5de9222
commit
d6f7c47eae
@ -50,9 +50,8 @@ type LuetGeneralConfig struct {
|
|||||||
FatalWarns bool `mapstructure:"fatal_warnings"`
|
FatalWarns bool `mapstructure:"fatal_warnings"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ResolverType string
|
|
||||||
type LuetSolverOptions struct {
|
type LuetSolverOptions struct {
|
||||||
Type ResolverType `mapstructure:"type"`
|
Type string `mapstructure:"type"`
|
||||||
LearnRate float32 `mapstructure:"rate"`
|
LearnRate float32 `mapstructure:"rate"`
|
||||||
Discount float32 `mapstructure:"discount"`
|
Discount float32 `mapstructure:"discount"`
|
||||||
MaxAttempts int `mapstructure:"max_attempts"`
|
MaxAttempts int `mapstructure:"max_attempts"`
|
||||||
@ -71,6 +70,11 @@ func (opts LuetSolverOptions) Resolver() solver.PackageResolver {
|
|||||||
return &solver.DummyPackageResolver{}
|
return &solver.DummyPackageResolver{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (opts *LuetSolverOptions) CompactString() string {
|
||||||
|
return fmt.Sprintf("type: %s rate: %f, discount: %f, attempts: %d, initialobserved: %d",
|
||||||
|
opts.Type, opts.LearnRate, opts.Discount, opts.MaxAttempts, 999999)
|
||||||
|
}
|
||||||
|
|
||||||
type LuetSystemConfig struct {
|
type LuetSystemConfig struct {
|
||||||
DatabaseEngine string `yaml:"database_engine" mapstructure:"database_engine"`
|
DatabaseEngine string `yaml:"database_engine" mapstructure:"database_engine"`
|
||||||
DatabasePath string `yaml:"database_path" mapstructure:"database_path"`
|
DatabasePath string `yaml:"database_path" mapstructure:"database_path"`
|
||||||
|
Loading…
Reference in New Issue
Block a user