ds4dm / ecole

Extensible Combinatorial Optimization Learning Environments
https://www.ecole.ai
BSD 3-Clause "New" or "Revised" License
318 stars 68 forks source link

Unable to deep copy environment #338

Open xtjjyygy opened 2 years ago

xtjjyygy commented 2 years ago

Describe the problem or improvement suggested

When branching, I want to deep copy multiple branch environments, but copy.deepcopy does not work, error is "TypeError: can't pickle ObservationFunction objects",

Environment like this: image

Thank you

Describe the solution you would like

Describe alternatives you have considered

Additional context

AntoinePrv commented 2 years ago

Hi @xtjjyygy, We'd also love to provide this feature, but there we would need to deep copy a SCIP object, which is not possible right now.

xtjjyygy commented 2 years ago

@AntoinePrv Thank you for your reply, I've tried writing deepcopy Method to copy multiple inherited classes, but ecole core. scip.Model class No constructor defined,Very frustrating. I wonder if you have a detailed plan to develop this feature. If it is convenient, I can also participate in the development of this feature. Thank you again!

Wastedzz commented 6 months ago

@AntoinePrv Thank you for your reply, I've tried writing deepcopy Method to copy multiple inherited classes, but ecole core. scip.Model class No constructor defined,Very frustrating. I wonder if you have a detailed plan to develop this feature. If it is convenient, I can also participate in the development of this feature. Thank you again!

Hello, I have met the same issue, have it been fixed now?