mirror of
https://github.com/mudler/luet.git
synced 2025-08-28 11:50:37 +00:00
Add compact string notation for SolverOptions
This commit is contained in:
parent
b2a5de9222
commit
d6f7c47eae
@ -50,12 +50,11 @@ type LuetGeneralConfig struct {
|
||||
FatalWarns bool `mapstructure:"fatal_warnings"`
|
||||
}
|
||||
|
||||
type ResolverType string
|
||||
type LuetSolverOptions struct {
|
||||
Type ResolverType `mapstructure:"type"`
|
||||
LearnRate float32 `mapstructure:"rate"`
|
||||
Discount float32 `mapstructure:"discount"`
|
||||
MaxAttempts int `mapstructure:"max_attempts"`
|
||||
Type string `mapstructure:"type"`
|
||||
LearnRate float32 `mapstructure:"rate"`
|
||||
Discount float32 `mapstructure:"discount"`
|
||||
MaxAttempts int `mapstructure:"max_attempts"`
|
||||
}
|
||||
|
||||
func (opts LuetSolverOptions) Resolver() solver.PackageResolver {
|
||||
@ -71,6 +70,11 @@ func (opts LuetSolverOptions) Resolver() solver.PackageResolver {
|
||||
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 {
|
||||
DatabaseEngine string `yaml:"database_engine" mapstructure:"database_engine"`
|
||||
DatabasePath string `yaml:"database_path" mapstructure:"database_path"`
|
||||
|
Loading…
Reference in New Issue
Block a user