Pyomo가 기본 표현식 유형 인 expr_coopr3.py
을 사용하는 이유는 무엇입니까? 나는 그것이 바뀔 수있는 방법을 발견했다. 그러나 만일 그것이 바른 길이라면 나는 의심을 품는다. 파일에서기본적으로 pyomo 4 표현식으로 전환
expr_common.py
try:
from sys import getrefcount
_getrefcount_available = False # changed!
except ImportError:
logger = logging.getLogger('pyomo.core')
logger.warning(
"This python interpreter does not support sys.getrefcount()\n"
"Pyomo cannot automatically guarantee that expressions do not become\n"
"entangled (multiple expressions that share common subexpressions).\n")
getrefcount = None
_getrefcount_available = False
class Mode(object):
coopr3_trees = (1,)
pyomo4_trees = (2,)
if _getrefcount_available:
mode = _default_mode = Mode.coopr3_trees
else:
mode = _default_mode = Mode.pyomo4_trees
변수 _getrefcount_available
이 False
에 할당 할 수 있으며, 모든 pyomo 식으로 작동 후 4.이 할 수있는 다른 방법이 있나요? 나는 당신이 식 트리 시스템을 전환 할 수 있습니다 Pyomo 5.2