relab / bandwidth-incentive-simulation

MIT License
0 stars 2 forks source link

Simplify configuration handling #5

Closed leandernikolaus closed 1 year ago

leandernikolaus commented 1 year ago

The config module contains two types, Yml and VariablesType. One is parsed by from the file, values are then copied to the other one. Would be good to simplify this.

leandernikolaus commented 1 year ago

Some config options require logic or validation. Should this be done on initializing, as is done with the go routines or when retrieving the value, as is done with EvaluateInterval. https://github.com/relab/bandwidth-incentive-simulation/blob/9dcfd4a114f6d635166692f0bf9034cc0566c646/config/init_configs.go#L63-L66

https://github.com/relab/bandwidth-incentive-simulation/blob/9dcfd4a114f6d635166692f0bf9034cc0566c646/config/get_variables.go#L278-L284

@VHPL-UIS any preferences?

VHPL-UIS commented 1 year ago

I prefer to do it on initialization phase and in Set functions. Get functions are responsible for retrieving the current value of a configuration option and should primarily focus on returning the value without any modification or validation.