Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
RTC-Tools
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
34
Issues
34
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Security & Compliance
Security & Compliance
Dependency List
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Deltares
RTC-Tools
Commits
fc9d4cab
Commit
fc9d4cab
authored
Nov 08, 2016
by
Jesse VanderWees
🐘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rearrange content for clarity
parent
0917c4c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
doc/examples/goal_programming.rst
doc/examples/goal_programming.rst
+7
-4
examples/goal_programming/src/example.py
examples/goal_programming/src/example.py
+1
-4
No files found.
doc/examples/goal_programming.rst
View file @
fc9d4cab
...
...
@@ -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
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
goal, called a ``StateGoal``:
our model at every time step, we can
inherit a special helper class to define
this
goal, called a ``StateGoal``:
.. literalinclude:: ../../examples/goal_programming/src/example.py
:language: python
...
...
@@ -168,8 +168,11 @@ optimizer.
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
we defined above. Goals that inherit ``StateGoal`` are always path goals and
must also always be initialized with the parameter ``self``.
we defined above. Note that with path goals, 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. 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
:language: python
...
...
examples/goal_programming/src/example.py
View file @
fc9d4cab
...
...
@@ -12,10 +12,7 @@ class WaterLevelRangeGoal(StateGoal):
# 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
# to determine the function, function range, and function nominal
# automatically. This type of goal can only be used with the path_goals()
# 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.
# automatically.
state
=
'storage.HQ.H'
# 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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment