2017-03-10 1 views
1

Je suis en train de créer plusieurs ensembles égaux avec différents names.I a essayé quelque chose comme ça:Créer le même jeu avec un nom différent dans Pyomo

model.j=model.i 

quelque chose que j'ai vu sur la documentation Pyomo dans le chapitre des opérations (4.2) mais quand je lance le programme, je reçois l'erreur suivante:

RuntimeError: Attempting to re-assign the component 'i' to the same 
block under a different name (j). 

This behavior is not supported by Pyomo; components must have a 
single owning block (or model), and a component may not appear 
multiple times in a block. If you want to re-name or move this 
component, use the block del_component() and add_component() methods. 

Répondre

0

la façon de le faire est d'initialiser un ensemble avec un autre

model.j = Set(initialize=model.i)