Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set_parameter! for ParallelDynamicalSystem #223

Open
rusandris opened this issue Oct 18, 2024 · 1 comment
Open

set_parameter! for ParallelDynamicalSystem #223

rusandris opened this issue Oct 18, 2024 · 1 comment

Comments

@rusandris
Copy link
Contributor

set_parameter! for ParallelDynamicalSystem is buggy, but easily fixable.

This is the discrete case, didn't check for continuous:

using DynamicalSystems
ds = Systems.henon()
pds = ParallelDynamicalSystem(ds,StateSpaceSet(rand(3,2)))
@which set_parameter!(pds,2,1.2) 

Here set_parameter! gets dispatched to the wrong method:
set_parameter!(ds::DynamicalSystem, index, value)
which only changes the parameter of the first system from pds.systems.

There is a method for ParallelDiscreteTimeDynamicalSystem

set_parameter!(pdtds::PDTDS) = for ds in pdtds.systems; set_parameter!(ds, args...); end

but that needs to be corrected for something like

set_parameter!(pdtds::PDTDS,index,value) = for ds in pdtds.systems; set_parameter!(ds, index,value); end

I'll make a small PR later.

@rusandris
Copy link
Contributor Author

Find the relevant commit here .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant