<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="es">
<head>
<!-- Generated by javadoc (version 1.7.0_51) on Thu Apr 10 11:52:58 CEST 2014 -->
<title>State</title>
<meta name="date" content="2014-04-10">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="State";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../JSHOP2/package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li><a href="../index-all.html">Index</a></li>
<li><a href="../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../JSHOP2/SolverThread.html" title="class in JSHOP2"><span class="strong">Prev Class</span></a></li>
<li><a href="../JSHOP2/StdLib.html" title="class in JSHOP2"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../index.html?JSHOP2/State.html" target="_top">Frames</a></li>
<li><a href="State.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">JSHOP2</div>
<h2 title="Class State" class="title">Class State</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>JSHOP2.State</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">State</span>
extends java.lang.Object</pre>
<div class="block">This class is used to represent the current state of the world.</div>
<dl><dt><span class="strong">Version:</span></dt>
  <dd>1.0.3</dd>
<dt><span class="strong">Author:</span></dt>
  <dd>Okhtay Ilghami, <a href="http://www.cs.umd.edu/~okhtay">http://www.cs.umd.edu/~okhtay</a></dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!--   -->
</a>
<h3>Field Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private java.util.Vector&lt;<a href="../JSHOP2/Term.html" title="class in JSHOP2">Term</a>&gt;[]</code></td>
<td class="colLast"><code><strong><a href="../JSHOP2/State.html#atoms">atoms</a></strong></code>
<div class="block">The atoms in the current state of the world as an array of
  <code>Vector</code>s.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private <a href="../JSHOP2/Axiom.html" title="class in JSHOP2">Axiom</a>[][]</code></td>
<td class="colLast"><code><strong><a href="../JSHOP2/State.html#axioms">axioms</a></strong></code>
<div class="block">The axioms in the domain description as a two-dimensional array.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private java.util.Vector&lt;<a href="../JSHOP2/NumberedPredicate.html" title="class in JSHOP2">NumberedPredicate</a>&gt;[]</code></td>
<td class="colLast"><code><strong><a href="../JSHOP2/State.html#protections">protections</a></strong></code>
<div class="block">The protections in the current state of the world as an array of
  <code>Vector</code>s.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../JSHOP2/State.html#State(int, JSHOP2.Axiom[][])">State</a></strong>(int&nbsp;size,
     <a href="../JSHOP2/Axiom.html" title="class in JSHOP2">Axiom</a>[][]&nbsp;axiomsIn)</code>
<div class="block">To initialize the state of the world.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../JSHOP2/State.html#add(JSHOP2.Predicate)">add</a></strong>(<a href="../JSHOP2/Predicate.html" title="class in JSHOP2">Predicate</a>&nbsp;p)</code>
<div class="block">To add a predicate to the current state of the world.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../JSHOP2/State.html#addProtection(JSHOP2.Predicate)">addProtection</a></strong>(<a href="../JSHOP2/Predicate.html" title="class in JSHOP2">Predicate</a>&nbsp;p)</code>
<div class="block">To protect a given predicate in the current state of the world.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../JSHOP2/State.html#clear()">clear</a></strong>()</code>
<div class="block">To empty the world state.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../JSHOP2/State.html#del(JSHOP2.Predicate)">del</a></strong>(<a href="../JSHOP2/Predicate.html" title="class in JSHOP2">Predicate</a>&nbsp;p)</code>
<div class="block">To delete a predicate from the current state of the world.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../JSHOP2/State.html#delProtection(JSHOP2.Predicate)">delProtection</a></strong>(<a href="../JSHOP2/Predicate.html" title="class in JSHOP2">Predicate</a>&nbsp;p)</code>
<div class="block">To unprotect a given predicate.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.util.ArrayList&lt;java.lang.String&gt;</code></td>
<td class="colLast"><code><strong><a href="../JSHOP2/State.html#getState()">getState</a></strong>()</code>
<div class="block">Returns an ArrayList of strings that represents the state.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../JSHOP2/State.html#isProtected(JSHOP2.Predicate)">isProtected</a></strong>(<a href="../JSHOP2/Predicate.html" title="class in JSHOP2">Predicate</a>&nbsp;p)</code>
<div class="block">To check if a predicate is protected.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../JSHOP2/MyIterator.html" title="class in JSHOP2">MyIterator</a></code></td>
<td class="colLast"><code><strong><a href="../JSHOP2/State.html#iterator(int)">iterator</a></strong>(int&nbsp;head)</code>
<div class="block">To initialize and return the appropriate iterator when looking
  for ways to satisfy a given predicate.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../JSHOP2/Term.html" title="class in JSHOP2">Term</a>[]</code></td>
<td class="colLast"><code><strong><a href="../JSHOP2/State.html#nextBinding(JSHOP2.Predicate, JSHOP2.MyIterator)">nextBinding</a></strong>(<a href="../JSHOP2/Predicate.html" title="class in JSHOP2">Predicate</a>&nbsp;p,
           <a href="../JSHOP2/MyIterator.html" title="class in JSHOP2">MyIterator</a>&nbsp;me)</code>
<div class="block">This function returns the bindings that can satisfy a given precondition
  one-by-one.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../JSHOP2/State.html#print()">print</a></strong>()</code>
<div class="block">This function is used to print the current state of the world.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../JSHOP2/State.html#undo(java.util.Vector[])">undo</a></strong>(java.util.Vector[]&nbsp;delAdd)</code>
<div class="block">This function is used, in case of a backtrack, to undo the changes that
 were made to the current state of the world because of the backtracked
 decision.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_detail">
<!--   -->
</a>
<h3>Field Detail</h3>
<a name="atoms">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>atoms</h4>
<pre>private&nbsp;java.util.Vector&lt;<a href="../JSHOP2/Term.html" title="class in JSHOP2">Term</a>&gt;[] atoms</pre>
<div class="block">The atoms in the current state of the world as an array of
  <code>Vector</code>s. The array is indexed by the possible heads (i.e.,
  the constant symbol that comes first) of the possible predicates.</div>
</li>
</ul>
<a name="axioms">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>axioms</h4>
<pre>private&nbsp;<a href="../JSHOP2/Axiom.html" title="class in JSHOP2">Axiom</a>[][] axioms</pre>
<div class="block">The axioms in the domain description as a two-dimensional array. The
  array is indexed first by the head of the predicates each axiom can prove
  and second by the axioms themselves.</div>
</li>
</ul>
<a name="protections">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>protections</h4>
<pre>private&nbsp;java.util.Vector&lt;<a href="../JSHOP2/NumberedPredicate.html" title="class in JSHOP2">NumberedPredicate</a>&gt;[] protections</pre>
<div class="block">The protections in the current state of the world as an array of
  <code>Vector</code>s. The array is indexed by the heads of protected
  predicates.</div>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="State(int, JSHOP2.Axiom[][])">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>State</h4>
<pre>public&nbsp;State(int&nbsp;size,
     <a href="../JSHOP2/Axiom.html" title="class in JSHOP2">Axiom</a>[][]&nbsp;axiomsIn)</pre>
<div class="block">To initialize the state of the world.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>size</code> - the number of possible heads of predicates (i.e., the number of
          constant symbols that can come first in a predicate).</dd><dd><code>axiomsIn</code> - the axioms in the domain description as a two-dimensional array.
          The array is indexed first by the head of the predicates each
          axiom can prove and second by the axioms themselves.</dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="add(JSHOP2.Predicate)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>add</h4>
<pre>public&nbsp;boolean&nbsp;add(<a href="../JSHOP2/Predicate.html" title="class in JSHOP2">Predicate</a>&nbsp;p)</pre>
<div class="block">To add a predicate to the current state of the world.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>p</code> - the predicate to be added.</dd>
<dt><span class="strong">Returns:</span></dt><dd><code>true</code> if the predicate was added (i.e., it was not
          already in the current state of the world), <code>false</code>
          otherwise.</dd></dl>
</li>
</ul>
<a name="addProtection(JSHOP2.Predicate)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addProtection</h4>
<pre>public&nbsp;boolean&nbsp;addProtection(<a href="../JSHOP2/Predicate.html" title="class in JSHOP2">Predicate</a>&nbsp;p)</pre>
<div class="block">To protect a given predicate in the current state of the world.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>p</code> - the predicate to be protected.</dd>
<dt><span class="strong">Returns:</span></dt><dd>this function always returns <code>true</code>.</dd></dl>
</li>
</ul>
<a name="clear()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>clear</h4>
<pre>public&nbsp;void&nbsp;clear()</pre>
<div class="block">To empty the world state.</div>
</li>
</ul>
<a name="del(JSHOP2.Predicate)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>del</h4>
<pre>public&nbsp;int&nbsp;del(<a href="../JSHOP2/Predicate.html" title="class in JSHOP2">Predicate</a>&nbsp;p)</pre>
<div class="block">To delete a predicate from the current state of the world.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>p</code> - the predicate to be deleted.</dd>
<dt><span class="strong">Returns:</span></dt><dd>the index of the predicate that was deleted in the
          <code>Vector</code> if the predicate was deleted (i.e., it
          existed in the current state of the world), -1 otherwise. This
          index is used in case of a backtrack to undo this deletion by
          inserting the deleted predicate right back where it used to be.</dd></dl>
</li>
</ul>
<a name="delProtection(JSHOP2.Predicate)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>delProtection</h4>
<pre>public&nbsp;boolean&nbsp;delProtection(<a href="../JSHOP2/Predicate.html" title="class in JSHOP2">Predicate</a>&nbsp;p)</pre>
<div class="block">To unprotect a given predicate.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>p</code> - the predicate to be unprotected.</dd>
<dt><span class="strong">Returns:</span></dt><dd><code>true</code> if the protected is unprotected successfully,
          <code>false</code> otherwise (i.e., when the predicate was not
          protected before).</dd></dl>
</li>
</ul>
<a name="isProtected(JSHOP2.Predicate)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isProtected</h4>
<pre>public&nbsp;boolean&nbsp;isProtected(<a href="../JSHOP2/Predicate.html" title="class in JSHOP2">Predicate</a>&nbsp;p)</pre>
<div class="block">To check if a predicate is protected.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>p</code> - the predicate to be checked.</dd>
<dt><span class="strong">Returns:</span></dt><dd><code>true</code> if the predicate is protected,
          <code>false</code> otherwise.</dd></dl>
</li>
</ul>
<a name="iterator(int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>iterator</h4>
<pre>public&nbsp;<a href="../JSHOP2/MyIterator.html" title="class in JSHOP2">MyIterator</a>&nbsp;iterator(int&nbsp;head)</pre>
<div class="block">To initialize and return the appropriate iterator when looking
  for ways to satisfy a given predicate.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>head</code> - the index of the constant symbol that is the head of the
          predicate (i.e., that comes first in the predicate).</dd>
<dt><span class="strong">Returns:</span></dt><dd>the iterator to be used to find the satisfiers for this
          predicate.</dd></dl>
</li>
</ul>
<a name="nextBinding(JSHOP2.Predicate, JSHOP2.MyIterator)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>nextBinding</h4>
<pre>public&nbsp;<a href="../JSHOP2/Term.html" title="class in JSHOP2">Term</a>[]&nbsp;nextBinding(<a href="../JSHOP2/Predicate.html" title="class in JSHOP2">Predicate</a>&nbsp;p,
                 <a href="../JSHOP2/MyIterator.html" title="class in JSHOP2">MyIterator</a>&nbsp;me)</pre>
<div class="block">This function returns the bindings that can satisfy a given precondition
  one-by-one.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>p</code> - the predicate to be satisfied.</dd><dd><code>me</code> - the iterator that keeps track of where we are with the satisfiers
          so that the next time this function is called, we can take off
          where we stopped last time.</dd>
<dt><span class="strong">Returns:</span></dt><dd>the next binding as an array of terms indexed by the indeices of
          the variable symbols in the given predicate.</dd></dl>
</li>
</ul>
<a name="print()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>print</h4>
<pre>public&nbsp;void&nbsp;print()</pre>
<div class="block">This function is used to print the current state of the world.</div>
</li>
</ul>
<a name="getState()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getState</h4>
<pre>public&nbsp;java.util.ArrayList&lt;java.lang.String&gt;&nbsp;getState()</pre>
<div class="block">Returns an ArrayList of strings that represents the state.  Used
 in conjunction with JSHOP2GUI
 (Added 5/28/06)</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>- An ArrayList<String> representing the state</dd></dl>
</li>
</ul>
<a name="undo(java.util.Vector[])">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>undo</h4>
<pre>public&nbsp;void&nbsp;undo(java.util.Vector[]&nbsp;delAdd)</pre>
<div class="block">This function is used, in case of a backtrack, to undo the changes that
 were made to the current state of the world because of the backtracked
 decision.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>delAdd</code> - a 4-member array of type <code>Vector</code>. These four
          members are the deleted atoms, the added atoms, the deleted
          protections and the added protections respectively.</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../JSHOP2/package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li><a href="../index-all.html">Index</a></li>
<li><a href="../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../JSHOP2/SolverThread.html" title="class in JSHOP2"><span class="strong">Prev Class</span></a></li>
<li><a href="../JSHOP2/StdLib.html" title="class in JSHOP2"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../index.html?JSHOP2/State.html" target="_top">Frames</a></li>
<li><a href="State.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
