Commit fc9d4cab authored by Jesse VanderWees's avatar Jesse VanderWees 🐘

rearrange content for clarity

parent 0917c4c1
...@@ -96,8 +96,8 @@ this example, we demonstrate three ways to define a goal in RTC-Tools. ...@@ -96,8 +96,8 @@ this example, we demonstrate three ways to define a goal in RTC-Tools.
First, we have a high priority goal to keep the water level within a minimum and First, we have a high priority goal to keep the water level within a minimum and
maximum. Since we are applying this goal to a specific state (model variable) in maximum. Since we are applying this goal to a specific state (model variable) in
our model at every time step, we can use a special helper class to define this our model at every time step, we can inherit a special helper class to define
goal, called a ``StateGoal``: this goal, called a ``StateGoal``:
.. literalinclude:: ../../examples/goal_programming/src/example.py .. literalinclude:: ../../examples/goal_programming/src/example.py
:language: python :language: python
...@@ -168,8 +168,11 @@ optimizer. ...@@ -168,8 +168,11 @@ optimizer.
For the goals that want to apply our goals to every timestep, so we use the For the goals that want to apply our goals to every timestep, so we use the
``path_goals()`` method. This is a method that returns a list of the path goals ``path_goals()`` method. This is a method that returns a list of the path goals
we defined above. Goals that inherit ``StateGoal`` are always path goals and we defined above. Note that with path goals, each timestep is implemented as
must also always be initialized with the parameter ``self``. an independant goal- if we cannot satisfy our min/max on time step A, it will
not affect our desire to satisfy the goal at time step B. Goals that inherit
``StateGoal`` are always path goals and must also always be initialized with the
parameter ``self``.
.. literalinclude:: ../../examples/goal_programming/src/example.py .. literalinclude:: ../../examples/goal_programming/src/example.py
:language: python :language: python
......
...@@ -12,10 +12,7 @@ class WaterLevelRangeGoal(StateGoal): ...@@ -12,10 +12,7 @@ class WaterLevelRangeGoal(StateGoal):
# Applying a state goal to every time step is easily done by defining a goal # Applying a state goal to every time step is easily done by defining a goal
# that inherits StateGoal. StateGoal is a helper class that uses the state # that inherits StateGoal. StateGoal is a helper class that uses the state
# to determine the function, function range, and function nominal # to determine the function, function range, and function nominal
# automatically. This type of goal can only be used with the path_goals() # automatically.
# method. Note that each timestep is implemented as an independant goal- if
# we cannot satisfy our min/max on time step A, it will not affect our
# desire to satisfy the goal at time step B.
state = 'storage.HQ.H' state = 'storage.HQ.H'
# One goal can introduce a single or two constraints (min and/or max). Our # One goal can introduce a single or two constraints (min and/or max). Our
# target water level range is 0.43 - 0.44. We might not always be able to # target water level range is 0.43 - 0.44. We might not always be able to
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment