143 lines
6.2 KiB
HTML
143 lines
6.2 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.8.16"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>EPANET: [RULES]</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">EPANET
|
|
 <span id="projectnumber">2.2.0</span>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.16 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
/* @license-end */</script>
|
|
<div id="main-nav"></div>
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<div id="nav-path" class="navpath">
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="_files.html">Toolkit Files</a></li><li class="navelem"><a class="el" href="_inp_file.html">Input File</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="PageDoc"><div class="header">
|
|
<div class="headertitle">
|
|
<div class="title">[RULES] </div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<div class="textblock"><p><b>Purpose:</b></p>
|
|
<p>Defines rule-based controls which modify links based on a combination of conditions.</p>
|
|
<p><b>Format:</b></p>
|
|
<p>Each rule is a series of statements of the form:</p>
|
|
<p><b>RULE</b>   <em>ruleID</em> <br />
|
|
<b>IF</b>       <em>condition_1</em> <br />
|
|
<b>AND</b>   <em>condition_2</em> <br />
|
|
<b>OR</b>     <em>condition_3</em> <br />
|
|
<b>AND</b>   <em>condition_4</em> <br />
|
|
etc. <br />
|
|
<b>THEN</b>  <em>action_1</em> <br />
|
|
<b>AND</b>   <em>action_2</em> <br />
|
|
etc. <br />
|
|
<b>ELSE</b>  <em>action_3</em> <br />
|
|
<b>AND</b>   <em>action_4</em> <br />
|
|
etc. <br />
|
|
<b>PRIORITY</b> <em>value</em> <br />
|
|
</p>
|
|
<p>where: </p><table style="border: 0px solid black">
|
|
<tr>
|
|
<td><em>ruleID</em> </td><td>= </td><td> an ID label assigned to the rule </td></tr>
|
|
<tr>
|
|
<td><em>conditon_n</em> </td><td>= </td><td> a <a class="el" href="_condition_clauses.html">condition clause</a> </td></tr>
|
|
<tr>
|
|
<td><em>action_n</em> </td><td>= </td><td> an <a class="el" href="_action_clauses.html">action clause</a> </td></tr>
|
|
<tr>
|
|
<td><b>PRIORITY</b> </td><td>= </td><td> a priority value (e.g., a number from 1 to 5) </td></tr>
|
|
</table>
|
|
<p><b>Remarks:</b></p><ol type="1">
|
|
<li>Only the <b>RULE, IF</b> and <b>THEN</b> portions of a rule are required; the other portions are optional.</li>
|
|
<li>When mixing <b>AND</b> and <b>OR</b> clauses, the <b>OR</b> operator has higher precedence than <b>AND</b>, i.e.,<br />
|
|
      <code>IF A or B and C</code> <br />
|
|
is equivalent to<br />
|
|
<br />
|
|
      <code>IF (A or B) and C</code> <br />
|
|
If the interpretation was meant to be<br />
|
|
      <code>IF A or (B and C)</code><br />
|
|
then this can be expressed using two rules as in<br />
|
|
      <code>IF A THEN ...</code> <br />
|
|
      <code>IF B and C THEN ...</code> <br />
|
|
</li>
|
|
<li>The <b>PRIORITY</b> value is used to determine which rule applies when two or more rules require that conflicting actions be taken on a link. A rule without a priority value always has a lower priority than one with a value. For two rules with the same priority value, the rule that appears first is given the higher priority.</li>
|
|
</ol>
|
|
<p><b>Example:</b> </p><div class="fragment"><div class="line">[RULES]</div>
|
|
<div class="line">RULE 1</div>
|
|
<div class="line">IF TANK 1 LEVEL ABOVE 19.1</div>
|
|
<div class="line">THEN PUMP 335 STATUS IS CLOSED</div>
|
|
<div class="line">AND PIPE 330 STATUS IS OPEN </div>
|
|
<div class="line"> </div>
|
|
<div class="line">RULE 2</div>
|
|
<div class="line">IF SYSTEM CLOCKTIME >= 8 AM</div>
|
|
<div class="line">AND SYSTEM CLOCKTIME < 6 PM</div>
|
|
<div class="line">AND TANK 1 LEVEL BELOW 12</div>
|
|
<div class="line">THEN PUMP 335 STATUS IS OPEN </div>
|
|
<div class="line"> </div>
|
|
<div class="line">RULE 3</div>
|
|
<div class="line">IF SYSTEM CLOCKTIME >= 6 PM</div>
|
|
<div class="line">OR SYSTEM CLOCKTIME < 8 AM</div>
|
|
<div class="line">AND TANK 1 LEVEL BELOW 14</div>
|
|
<div class="line">THEN PUMP 335 STATUS IS OPEN</div>
|
|
</div><!-- fragment --> </div></div><!-- contents -->
|
|
</div><!-- PageDoc -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
|
</a> 1.8.16
|
|
</small></address>
|
|
</body>
|
|
</html>
|