B ิย_ใ@s8ddlTddlmZGdd„deƒZGdd„deƒZdS)้)ฺ*)ฺ phextensionc@sfeZdZeejƒdd„Zdd„Zdd„Zdd„Z d d „Z d d „Z d d„Z dd„Z dd„Zdd„ZdS)ฺexamplephextensioncCs tdƒdS)zCInvoked to reset the state of a plugin to that of post-constructionzRESET PH CALLBACK INVOKEDN)ฺprint)ฺselfฺphฉr๚I/tmp/pip-unpacked-wheel-d4p3hk07/pyomo/pysp/plugins/examplephextension.pyฺresetszexamplephextension.resetcCs tdƒdS)z Called before PH initialization.z&PRE INITIALIZATION PH CALLBACK INVOKEDN)r)rrrrr ฺpre_ph_initializationsz(examplephextension.pre_ph_initializationcCs tdƒdS)zŠCalled after PH initialization has created the scenario instances, but before any PH-related weights/variables/parameters/etc are defined!z*POST INSTANCE CREATION PH CALLBACK INVOKEDN)r)rrrrr ฺpost_instance_creationsz)examplephextension.post_instance_creationcCs tdƒdS)zCalled after PH initialization!z'POST INITIALIZATION PH CALLBACK INVOKEDN)r)rrrrr ฺpost_ph_initializationsz)examplephextension.post_ph_initializationcCs tdƒdS)z$Called after the iteration 0 solves!z*POST ITERATION 0 SOLVE PH CALLBACK INVOKEDN)r)rrrrr ฺpost_iteration_0_solves#sz*examplephextension.post_iteration_0_solvescCs tdƒdS)zQCalled after the iteration 0 solves, averages computation, and weight computationz$POST ITERATION 0 PH CALLBACK INVOKEDN)r)rrrrr ฺpost_iteration_0'sz#examplephextension.post_iteration_0cCs tdƒdS)z1Called immediately before the iteration k solves!z)PRE ITERATION K SOLVE PH CALLBACK INVOKEDN)r)rrrrr ฺpre_iteration_k_solves+sz)examplephextension.pre_iteration_k_solvescCs tdƒdS)z$Called after the iteration k solves!z*POST ITERATION K SOLVE PH CALLBACK INVOKEDN)r)rrrrr ฺpost_iteration_k_solves/sz*examplephextension.post_iteration_k_solvescCs tdƒdS)zJCalled after the iteration k is finished, after weights have been updated!z$POST ITERATION K PH CALLBACK INVOKEDN)r)rrrrr ฺpost_iteration_k3sz#examplephextension.post_iteration_kcCs tdƒdS)zCalled after PH has terminated!z"POST EXECUTION PH CALLBACK INVOKEDN)r)rrrrr ฺpost_ph_execution7sz$examplephextension.post_ph_executionN)ฺ__name__ฺ __module__ฺ __qualname__ฺ implementsrZ IPHExtensionr r r r rrrrrrrrrr rs rc@sNeZdZeejƒdd„Zdd„Zdd„Zdd„Z d d „Z d d „Z d d„Z dS)ฺexamplephsolverserverextensioncCstd|jƒdS)z Called before PH initialization.z>PRE INITIALIZATION PHSOLVERSERVER CALLBACK INVOKED ON WORKER: N)rฺ WORKERNAME)rrrrr r @sz4examplephsolverserverextension.pre_ph_initializationcCstd|jƒdS)z-Called after the instances have been created.zBPOST INSTANCE CREATION PHSOLVERSERVER CALLBACK INVOKED ON WORKER: N)rr)rrrrr r Dsz5examplephsolverserverextension.post_instance_creationcCstd|jƒdS)zCalled after PH initialization!z?POST INITIALIZATION PHSOLVERSERVER CALLBACK INVOKED ON WORKER: N)rr)rrrrr r Hsz5examplephsolverserverextension.post_ph_initializationcCstd|jƒdS)z+Called before the iteration 0 solve begins!zAPRE ITERATION 0 SOLVE PHSOLVERSERVER CALLBACK INVOKED ON WORKER: N)rr)rrrrr ฺpre_iteration_0_solveLsz4examplephsolverserverextension.pre_iteration_0_solvecCstd|jƒdS)z/Called after the iteration 0 solve is finished!zBPOST ITERATION 0 SOLVE PHSOLVERSERVER CALLBACK INVOKED ON WORKER: N)rr)rrrrr ฺpost_iteration_0_solvePsz5examplephsolverserverextension.post_iteration_0_solvecCstd|jƒdS)z+Called before the iteration k solve begins!zAPRE ITERATION K SOLVE PHSOLVERSERVER CALLBACK INVOKED ON WORKER: N)rr)rrrrr ฺpre_iteration_k_solveTsz4examplephsolverserverextension.pre_iteration_k_solvecCstd|jƒdS)z/Called after the iteration k solve is finished!zBPOST ITERATION K SOLVE PHSOLVERSERVER CALLBACK INVOKED ON WORKER: N)rr)rrrrr ฺpost_iteration_k_solveXsz5examplephsolverserverextension.post_iteration_k_solveN) rrrrrZIPHSolverServerExtensionr r r rrrrrrrr r<s rN)Zpyomo.common.pluginZ pyomo.pysprZSingletonPluginrrrrrr ฺ s -