numagic / lumos

scalable accelerated optimal control
MIT License
16 stars 0 forks source link

should we change recursive_params to a copy? #76

Closed yunlongxu-numagic closed 1 year ago

yunlongxu-numagic commented 2 years ago

currently the get_recursive_params would actually return objects pointing to the submodel parameters directly, meaning we would directly have effect on the model by changing the model params, see here

eg:

model_params = model.get_recursive_params()
model_params.set_param("vehicle.body_mass", 10) # This would already take effect

# model.set_recursive_params(model_params) # this is not necessary

Would this likely result in issues of accidental change of parameters? Should we create a copy with the get_recursive_params call?