doc/TaskJuggler/Scoreboard.html in taskjuggler-0.0.7 vs doc/TaskJuggler/Scoreboard.html in taskjuggler-0.0.8

- old
+ new

@@ -167,16 +167,22 @@ <li><a href="../TaskJuggler/ChargeSet.html">TaskJuggler::ChargeSet</a></li> <li><a href="../TaskJuggler/ChargeSetListAttribute.html">TaskJuggler::ChargeSetListAttribute</a></li> + <li><a href="../TaskJuggler/CollisionDetector.html">TaskJuggler::CollisionDetector</a></li> + <li><a href="../TaskJuggler/ColumnListAttribute.html">TaskJuggler::ColumnListAttribute</a></li> <li><a href="../TaskJuggler/ColumnTable.html">TaskJuggler::ColumnTable</a></li> <li><a href="../TaskJuggler/Daemon.html">TaskJuggler::Daemon</a></li> + <li><a href="../TaskJuggler/DataCache.html">TaskJuggler::DataCache</a></li> + + <li><a href="../TaskJuggler/DataCacheEntry.html">TaskJuggler::DataCacheEntry</a></li> + <li><a href="../TaskJuggler/DateAttribute.html">TaskJuggler::DateAttribute</a></li> <li><a href="../TaskJuggler/DefinitionListAttribute.html">TaskJuggler::DefinitionListAttribute</a></li> <li><a href="../TaskJuggler/DependencyListAttribute.html">TaskJuggler::DependencyListAttribute</a></li> @@ -279,11 +285,11 @@ <li><a href="../TaskJuggler/NikuResource.html">TaskJuggler::NikuResource</a></li> <li><a href="../TaskJuggler/NodeListAttribute.html">TaskJuggler::NodeListAttribute</a></li> - <li><a href="../TaskJuggler/OnShiftCache.html">TaskJuggler::OnShiftCache</a></li> + <li><a href="../TaskJuggler/PlaceHolderCell.html">TaskJuggler::PlaceHolderCell</a></li> <li><a href="../TaskJuggler/ProcessIntercom.html">TaskJuggler::ProcessIntercom</a></li> <li><a href="../TaskJuggler/ProcessIntercomIface.html">TaskJuggler::ProcessIntercomIface</a></li> @@ -459,10 +465,14 @@ <li><a href="../TaskJuggler/TextParser/Rule.html">TaskJuggler::TextParser::Rule</a></li> <li><a href="../TaskJuggler/TextParser/StackElement.html">TaskJuggler::TextParser::StackElement</a></li> + <li><a href="../TaskJuggler/TextParser/State.html">TaskJuggler::TextParser::State</a></li> + + <li><a href="../TaskJuggler/TextParser/StateTransition.html">TaskJuggler::TextParser::StateTransition</a></li> + <li><a href="../TaskJuggler/TextParser/TextParserResultArray.html">TaskJuggler::TextParser::TextParserResultArray</a></li> <li><a href="../TaskJuggler/TextParser/TokenDoc.html">TaskJuggler::TextParser::TokenDoc</a></li> <li><a href="../TaskJuggler/TextReport.html">TaskJuggler::TextReport</a></li> @@ -724,14 +734,14 @@ <div class="method-source-code" id="--source"> <pre> - <span class="ruby-comment cmt"># File lib/Scoreboard.rb, line 78</span> -78: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">idx</span>) -79: <span class="ruby-ivar">@sb</span>[<span class="ruby-identifier">idx</span>] -80: <span class="ruby-keyword kw">end</span></pre> + <span class="ruby-comment cmt"># File lib/Scoreboard.rb, line 87</span> +87: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">idx</span>) +88: <span class="ruby-ivar">@sb</span>[<span class="ruby-identifier">idx</span>] +89: <span class="ruby-keyword kw">end</span></pre> </div> </div> @@ -760,14 +770,14 @@ <div class="method-source-code" id="--source"> <pre> - <span class="ruby-comment cmt"># File lib/Scoreboard.rb, line 83</span> -83: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]=</span>(<span class="ruby-identifier">idx</span>, <span class="ruby-identifier">value</span>) -84: <span class="ruby-ivar">@sb</span>[<span class="ruby-identifier">idx</span>] = <span class="ruby-identifier">value</span> -85: <span class="ruby-keyword kw">end</span></pre> + <span class="ruby-comment cmt"># File lib/Scoreboard.rb, line 92</span> +92: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]=</span>(<span class="ruby-identifier">idx</span>, <span class="ruby-identifier">value</span>) +93: <span class="ruby-ivar">@sb</span>[<span class="ruby-identifier">idx</span>] = <span class="ruby-identifier">value</span> +94: <span class="ruby-keyword kw">end</span></pre> </div> </div> @@ -832,14 +842,14 @@ <div class="method-source-code" id="collect--source"> <pre> - <span class="ruby-comment cmt"># File lib/Scoreboard.rb, line 73</span> -73: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">collect!</span> -74: <span class="ruby-ivar">@sb</span>.<span class="ruby-identifier">collect!</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">x</span> } -75: <span class="ruby-keyword kw">end</span></pre> + <span class="ruby-comment cmt"># File lib/Scoreboard.rb, line 82</span> +82: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">collect!</span> +83: <span class="ruby-ivar">@sb</span>.<span class="ruby-identifier">collect!</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">x</span> } +84: <span class="ruby-keyword kw">end</span></pre> </div> </div> @@ -872,46 +882,46 @@ <div class="method-source-code" id="collect-ntervals-source"> <pre> - <span class="ruby-comment cmt"># File lib/Scoreboard.rb, line 102</span> -102: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">collectIntervals</span>(<span class="ruby-identifier">iv</span>, <span class="ruby-identifier">minDuration</span>) -103: <span class="ruby-comment cmt"># Determine the start and stop index for the scoreboard search.</span> -104: <span class="ruby-identifier">startIdx</span> = <span class="ruby-identifier">dateToIdx</span>(<span class="ruby-identifier">iv</span>.<span class="ruby-identifier">start</span>, <span class="ruby-keyword kw">true</span>) -105: <span class="ruby-identifier">endIdx</span> = <span class="ruby-identifier">dateToIdx</span>(<span class="ruby-identifier">iv</span>.<span class="ruby-identifier">end</span>, <span class="ruby-keyword kw">true</span>) -106: -107: <span class="ruby-comment cmt"># Convert the minDuration into number of slots.</span> -108: <span class="ruby-identifier">minDuration</span> <span class="ruby-operator">/=</span> <span class="ruby-ivar">@resolution</span> -109: <span class="ruby-identifier">minDuration</span> = <span class="ruby-value">1</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">minDuration</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-value">0</span> -110: -111: <span class="ruby-comment cmt"># This is collects the resulting intervals.</span> -112: <span class="ruby-identifier">intervals</span> = [] -113: <span class="ruby-comment cmt"># The duration counter for the currently analyzed interval and the start</span> -114: <span class="ruby-comment cmt"># index.</span> -115: <span class="ruby-identifier">duration</span> = <span class="ruby-identifier">start</span> = <span class="ruby-value">0</span> -116: -117: <span class="ruby-identifier">startIdx</span>.<span class="ruby-identifier">upto</span>(<span class="ruby-identifier">endIdx</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">idx</span><span class="ruby-operator">|</span> -118: <span class="ruby-comment cmt"># Check whether the scoreboard slot matches any of the target values.</span> -119: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">yield</span>(<span class="ruby-ivar">@sb</span>[<span class="ruby-identifier">idx</span>]) -120: <span class="ruby-comment cmt"># If so, save the start position if this is the first slot and start</span> -121: <span class="ruby-comment cmt"># counting the matching slots.</span> -122: <span class="ruby-identifier">start</span> = <span class="ruby-identifier">idx</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">start</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> -123: <span class="ruby-identifier">duration</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> -124: <span class="ruby-keyword kw">else</span> -125: <span class="ruby-comment cmt"># If we don't have a match, check if we've just finished a matching</span> -126: <span class="ruby-comment cmt"># interval.</span> -127: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">duration</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span> -128: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">duration</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-identifier">minDuration</span> -129: <span class="ruby-identifier">intervals</span> <span class="ruby-operator">&lt;&lt;</span> [ <span class="ruby-identifier">idxToDate</span>(<span class="ruby-identifier">start</span>), <span class="ruby-identifier">idxToDate</span>(<span class="ruby-identifier">idx</span>) ] -130: <span class="ruby-keyword kw">end</span> -131: <span class="ruby-identifier">duration</span> = <span class="ruby-identifier">start</span> = <span class="ruby-value">0</span> -132: <span class="ruby-keyword kw">end</span> -133: <span class="ruby-keyword kw">end</span> -134: <span class="ruby-keyword kw">end</span> -135: <span class="ruby-identifier">intervals</span> -136: <span class="ruby-keyword kw">end</span></pre> + <span class="ruby-comment cmt"># File lib/Scoreboard.rb, line 111</span> +111: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">collectIntervals</span>(<span class="ruby-identifier">iv</span>, <span class="ruby-identifier">minDuration</span>) +112: <span class="ruby-comment cmt"># Determine the start and stop index for the scoreboard search.</span> +113: <span class="ruby-identifier">startIdx</span> = <span class="ruby-identifier">dateToIdx</span>(<span class="ruby-identifier">iv</span>.<span class="ruby-identifier">start</span>, <span class="ruby-keyword kw">true</span>) +114: <span class="ruby-identifier">endIdx</span> = <span class="ruby-identifier">dateToIdx</span>(<span class="ruby-identifier">iv</span>.<span class="ruby-identifier">end</span>, <span class="ruby-keyword kw">true</span>) +115: +116: <span class="ruby-comment cmt"># Convert the minDuration into number of slots.</span> +117: <span class="ruby-identifier">minDuration</span> <span class="ruby-operator">/=</span> <span class="ruby-ivar">@resolution</span> +118: <span class="ruby-identifier">minDuration</span> = <span class="ruby-value">1</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">minDuration</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-value">0</span> +119: +120: <span class="ruby-comment cmt"># This is collects the resulting intervals.</span> +121: <span class="ruby-identifier">intervals</span> = [] +122: <span class="ruby-comment cmt"># The duration counter for the currently analyzed interval and the start</span> +123: <span class="ruby-comment cmt"># index.</span> +124: <span class="ruby-identifier">duration</span> = <span class="ruby-identifier">start</span> = <span class="ruby-value">0</span> +125: +126: <span class="ruby-identifier">startIdx</span>.<span class="ruby-identifier">upto</span>(<span class="ruby-identifier">endIdx</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">idx</span><span class="ruby-operator">|</span> +127: <span class="ruby-comment cmt"># Check whether the scoreboard slot matches any of the target values.</span> +128: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">yield</span>(<span class="ruby-ivar">@sb</span>[<span class="ruby-identifier">idx</span>]) +129: <span class="ruby-comment cmt"># If so, save the start position if this is the first slot and start</span> +130: <span class="ruby-comment cmt"># counting the matching slots.</span> +131: <span class="ruby-identifier">start</span> = <span class="ruby-identifier">idx</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">start</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> +132: <span class="ruby-identifier">duration</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> +133: <span class="ruby-keyword kw">else</span> +134: <span class="ruby-comment cmt"># If we don't have a match, check if we've just finished a matching</span> +135: <span class="ruby-comment cmt"># interval.</span> +136: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">duration</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span> +137: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">duration</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-identifier">minDuration</span> +138: <span class="ruby-identifier">intervals</span> <span class="ruby-operator">&lt;&lt;</span> [ <span class="ruby-identifier">idxToDate</span>(<span class="ruby-identifier">start</span>), <span class="ruby-identifier">idxToDate</span>(<span class="ruby-identifier">idx</span>) ] +139: <span class="ruby-keyword kw">end</span> +140: <span class="ruby-identifier">duration</span> = <span class="ruby-identifier">start</span> = <span class="ruby-value">0</span> +141: <span class="ruby-keyword kw">end</span> +142: <span class="ruby-keyword kw">end</span> +143: <span class="ruby-keyword kw">end</span> +144: <span class="ruby-identifier">intervals</span> +145: <span class="ruby-keyword kw">end</span></pre> </div> </div> @@ -943,19 +953,22 @@ <div class="method-source-code" id="date-o-dx-source"> <pre> <span class="ruby-comment cmt"># File lib/Scoreboard.rb, line 54</span> 54: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dateToIdx</span>(<span class="ruby-identifier">date</span>, <span class="ruby-identifier">forceIntoProject</span> = <span class="ruby-keyword kw">false</span>) -55: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">forceIntoProject</span> -56: <span class="ruby-keyword kw">return</span> <span class="ruby-value">0</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">date</span> <span class="ruby-operator">&lt;</span> <span class="ruby-ivar">@startDate</span> -57: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">date</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-ivar">@endDate</span> -58: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">date</span> <span class="ruby-operator">&lt;</span> <span class="ruby-ivar">@startDate</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">date</span> <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@endDate</span> -59: <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Date #{date} is out of project time range &quot;</span> <span class="ruby-operator">+</span> -60: <span class="ruby-node">&quot;(#{@startDate} - #{@endDate})&quot;</span> -61: <span class="ruby-keyword kw">end</span> -62: ((<span class="ruby-identifier">date</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@startDate</span>) <span class="ruby-operator">/</span> <span class="ruby-ivar">@resolution</span>).<span class="ruby-identifier">to_i</span> -63: <span class="ruby-keyword kw">end</span></pre> +55: <span class="ruby-identifier">idx</span> = ((<span class="ruby-identifier">date</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@startDate</span>) <span class="ruby-operator">/</span> <span class="ruby-ivar">@resolution</span>).<span class="ruby-identifier">to_i</span> +56: +57: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">forceIntoProject</span> +58: <span class="ruby-keyword kw">return</span> <span class="ruby-value">0</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">idx</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span> +59: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">idx</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-ivar">@size</span> +60: <span class="ruby-keyword kw">elsif</span> (<span class="ruby-identifier">idx</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">idx</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-ivar">@size</span>) +61: <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Date #{date} is out of project time range &quot;</span> <span class="ruby-operator">+</span> +62: <span class="ruby-node">&quot;(#{@startDate} - #{@endDate})&quot;</span> +63: <span class="ruby-keyword kw">end</span> +64: +65: <span class="ruby-identifier">idx</span> +66: <span class="ruby-keyword kw">end</span></pre> </div> </div> @@ -968,11 +981,11 @@ <a name="method-i-each"></a> <div class="method-heading"> <span class="method-name">each</span><span - class="method-args">()</span> + class="method-args">(startIdx = 0, endIdx = @size)</span> <span class="method-click-advice">click to toggle source</span> </div> <div class="method-description"> @@ -984,16 +997,22 @@ <div class="method-source-code" id="each-source"> <pre> - <span class="ruby-comment cmt"># File lib/Scoreboard.rb, line 66</span> -66: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each</span> -67: <span class="ruby-ivar">@sb</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">entry</span><span class="ruby-operator">|</span> -68: <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">entry</span> -69: <span class="ruby-keyword kw">end</span> -70: <span class="ruby-keyword kw">end</span></pre> + <span class="ruby-comment cmt"># File lib/Scoreboard.rb, line 69</span> +69: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each</span>(<span class="ruby-identifier">startIdx</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">endIdx</span> = <span class="ruby-ivar">@size</span>) +70: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">startIdx</span> <span class="ruby-operator">!=</span> <span class="ruby-value">0</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">endIdx</span> <span class="ruby-operator">!=</span> <span class="ruby-ivar">@size</span> +71: <span class="ruby-identifier">startIdx</span>.<span class="ruby-identifier">upto</span>(<span class="ruby-identifier">endIdx</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> +72: <span class="ruby-keyword kw">yield</span> <span class="ruby-ivar">@sb</span>[<span class="ruby-identifier">i</span>] +73: <span class="ruby-keyword kw">end</span> +74: <span class="ruby-keyword kw">else</span> +75: <span class="ruby-ivar">@sb</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">entry</span><span class="ruby-operator">|</span> +76: <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">entry</span> +77: <span class="ruby-keyword kw">end</span> +78: <span class="ruby-keyword kw">end</span> +79: <span class="ruby-keyword kw">end</span></pre> </div> </div> @@ -1022,14 +1041,14 @@ <div class="method-source-code" id="get-source"> <pre> - <span class="ruby-comment cmt"># File lib/Scoreboard.rb, line 88</span> -88: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get</span>(<span class="ruby-identifier">date</span>) -89: <span class="ruby-ivar">@sb</span>[<span class="ruby-identifier">dateToIdx</span>(<span class="ruby-identifier">date</span>)] -90: <span class="ruby-keyword kw">end</span></pre> + <span class="ruby-comment cmt"># File lib/Scoreboard.rb, line 97</span> +97: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get</span>(<span class="ruby-identifier">date</span>) +98: <span class="ruby-ivar">@sb</span>[<span class="ruby-identifier">dateToIdx</span>(<span class="ruby-identifier">date</span>)] +99: <span class="ruby-keyword kw">end</span></pre> </div> </div> @@ -1101,13 +1120,13 @@ <div class="method-source-code" id="set-source"> <pre> - <span class="ruby-comment cmt"># File lib/Scoreboard.rb, line 93</span> -93: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set</span>(<span class="ruby-identifier">date</span>, <span class="ruby-identifier">value</span>) -94: <span class="ruby-ivar">@sb</span>[<span class="ruby-identifier">dateToIdx</span>(<span class="ruby-identifier">date</span>)] = <span class="ruby-identifier">value</span> -95: <span class="ruby-keyword kw">end</span></pre> + <span class="ruby-comment cmt"># File lib/Scoreboard.rb, line 102</span> +102: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set</span>(<span class="ruby-identifier">date</span>, <span class="ruby-identifier">value</span>) +103: <span class="ruby-ivar">@sb</span>[<span class="ruby-identifier">dateToIdx</span>(<span class="ruby-identifier">date</span>)] = <span class="ruby-identifier">value</span> +104: <span class="ruby-keyword kw">end</span></pre> </div> </div>