<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Ferasferas&#039;s Blog</title>
	<atom:link href="http://ferasferas.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ferasferas.wordpress.com</link>
	<description>Blog About Computing</description>
	<lastBuildDate>Fri, 18 Mar 2011 21:49:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='ferasferas.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Ferasferas&#039;s Blog</title>
		<link>http://ferasferas.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://ferasferas.wordpress.com/osd.xml" title="Ferasferas&#039;s Blog" />
	<atom:link rel='hub' href='http://ferasferas.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Get all palindromes</title>
		<link>http://ferasferas.wordpress.com/2011/01/01/get-all-palindromes/</link>
		<comments>http://ferasferas.wordpress.com/2011/01/01/get-all-palindromes/#comments</comments>
		<pubDate>Sat, 01 Jan 2011 16:38:27 +0000</pubDate>
		<dc:creator>ferasferas</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Math & Algorithms]]></category>

		<guid isPermaLink="false">http://ferasferas.wordpress.com/?p=348</guid>
		<description><![CDATA[Problem Definition: given a string of length n check for all subsets of this string if the are palindromes or not. Problem Tackling Approach: To solve this problem in a brute force way it will take about O(n^3) ,because it will be something like this. Algorithm 1: For all char ‘a’ belongs to S do [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ferasferas.wordpress.com&amp;blog=7413391&amp;post=348&amp;subd=ferasferas&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Problem Definition:<br />
given a string of length n check for all subsets of this string if the are<br />
palindromes or not.</p>
<p>Problem Tackling Approach:<br />
To solve this problem in a brute force way it will take about O(n^3) ,because it<br />
will be something like this.</p>
<p>Algorithm 1:<br />
<code>For all char ‘a’ belongs to S do<br />
For all char ‘b’  belongs S and after char ‘a’ do<br />
Check_Palindrome(String(a,b))</code></p>
<p>This algorithm is doomed if it’s part in solving a bigger problem also if  n grows large, but this algorithm showed a pattern here let’s look at this example.</p>
<p>Ex1:<br />
Let our string here be “aaabbaaa”, when we apply Algorithm 1 you will notice the pattern when we apply function “Check_Palindromes” first to the string starting at index 0 to index 7 and  to string at index 1 to index 6.<br />
The Pattern is we checked if the substring from index 2 to 5 is palindrome twice!.</p>
<p>This pattern tells us we can divide it into small subsets and solve it with straight forward Dynammic Programming with O(n^2).</p>
<p>Algorithm 2:</p>
<p><code>for ( int spaces = 1; spaces &lt; n; spaces++)<br />
for(int startIndex = 0; startIndex &lt; n &amp;&amp; startIndex+spaces &lt; n; startIndex++)<br />
If( String[startIndex] == String[startIndex + spaces]   &amp;&amp; DP[startIndex+1][spaces-1])<br />
{<br />
DP[startIndex][spaces] = true;<br />
}</code></p>
<p>Ok, that’s all of it hope you find it challenging.</p>
<p>Problem Reference:<br />
-idea of the problem taken from codechef Octobor 2010 contest.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ferasferas.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ferasferas.wordpress.com/348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ferasferas.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ferasferas.wordpress.com/348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ferasferas.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ferasferas.wordpress.com/348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ferasferas.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ferasferas.wordpress.com/348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ferasferas.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ferasferas.wordpress.com/348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ferasferas.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ferasferas.wordpress.com/348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ferasferas.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ferasferas.wordpress.com/348/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ferasferas.wordpress.com&amp;blog=7413391&amp;post=348&amp;subd=ferasferas&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ferasferas.wordpress.com/2011/01/01/get-all-palindromes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fe322488701d50730f07f91b9689a718?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ferasferas</media:title>
		</media:content>
	</item>
		<item>
		<title>Introduction to Memory Management on iPhone</title>
		<link>http://ferasferas.wordpress.com/2010/12/05/introduction-to-memory-management-on-iphone/</link>
		<comments>http://ferasferas.wordpress.com/2010/12/05/introduction-to-memory-management-on-iphone/#comments</comments>
		<pubDate>Sun, 05 Dec 2010 19:35:25 +0000</pubDate>
		<dc:creator>ferasferas</dc:creator>
				<category><![CDATA[Objective-C]]></category>

		<guid isPermaLink="false">http://ferasferas.wordpress.com/?p=341</guid>
		<description><![CDATA[Content of this Article: &#62;Memory Management Model. &#62;How to allocate, retain and release Objects in Memory. &#62;Using nil to safe release Objects. &#62;References. Memory Management Model in iOS dosen&#8217;t have a Garbage Collector inorder to increase the performance of the language on the mobile platform which is constrained to small computational power. Forthat it uses [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ferasferas.wordpress.com&amp;blog=7413391&amp;post=341&amp;subd=ferasferas&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } 		A:link { so-language: zxx } -->Content of this Article:</p>
<p>&gt;Memory Management Model.</p>
<p>&gt;How to allocate, retain and release Objects in Memory.</p>
<p>&gt;Using nil to safe release Objects.</p>
<p>&gt;References.</p>
<p><strong>Memory Management Model </strong>in iOS dosen&#8217;t have a Garbage Collector inorder to increase the performance of the language on the mobile platform which is constrained to small computational power. Forthat it uses <strong><a href="http://en.wikipedia.org/wiki/Reference_counting">Reference Counting</a> </strong>the idea of Reference Couting is very simple every object you define in the memory have a number that counts how many items reference this object, When it reaches zero the object is deallocated from the memory since no other object needs it.</p>
<p>Let&#8217;s take it to the Next Step <strong>Memory Allocation, </strong>to allocate an object we will use the keyword <strong>“alloc”</strong> and then call “init” to initialize the object, for Example:</p>
<p><code>NSString *string_1 = [[NSString alloc] init];</code></p>
<p>Now the reference count of the object is “1”, since alloc will allocate a memory block and makes it&#8217;s reference count to “1”.  if another object referenced the same object the reference count wil increase by  “1” (current reference count = 2) :</p>
<p><code>NSString *string_2 = [string_1 retain];</code></p>
<p>But after doing all these alloc and retain operations we are going to be faced with a huge problem which is <strong><a href="http://en.wikipedia.org/wiki/Memory_leak">Memory Leaks</a></strong>, objects tha aren&#8217;t needed or out of our scope will resides in the memory and won&#8217;t be garbage collected, Why ? Because there reference count isn&#8217;t “0”.  <strong>Calling “release”</strong> every time on an object will decrease the reference count of the object by one.</p>
<p><code>[string_1 release];  //now reference count is “1”.</p>
<p>[string_1 release];  //now reference count is “0”, and the object will be deallocated.<br />
</code><br />
<strong>since “nil” can be retained or released, by </strong>using this great advantage you can define a setter for your variable which will realese your object and assign it to nil. Why is that even useful ? It&#8217;s very helpful to not fail in an invalid pointer operation, for example:</p>
<p><code>-(void) setStr:(NSString *) input{<br />
[input retain];<br />
[myStr release];<br />
myStr = input;<br />
}</p>
<p><code>-(void) callFunction:(id)sender {<br />
if(myStr)<br />
//do something …..<br />
else<br />
//pointer assigned to null can't do anything …..<br />
}</code></p>
<p><code>-(void) dealloc {<br />
[self setStr:nil];<br />
[super release];<br />
}</code><br />
</code><br />
<strong>References:</strong></p>
<p><a name="title"></a> &#8211; <a href="http://oreilly.com/catalog/9780596806446">Learning iPhone Programming</a></p>
<p>- <a href="http://www.markj.net/iphone-memory-management-tutorial-video/">Memory Management Basics Tutorial Video</a> by Mark</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ferasferas.wordpress.com/341/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ferasferas.wordpress.com/341/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ferasferas.wordpress.com/341/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ferasferas.wordpress.com/341/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ferasferas.wordpress.com/341/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ferasferas.wordpress.com/341/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ferasferas.wordpress.com/341/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ferasferas.wordpress.com/341/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ferasferas.wordpress.com/341/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ferasferas.wordpress.com/341/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ferasferas.wordpress.com/341/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ferasferas.wordpress.com/341/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ferasferas.wordpress.com/341/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ferasferas.wordpress.com/341/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ferasferas.wordpress.com&amp;blog=7413391&amp;post=341&amp;subd=ferasferas&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ferasferas.wordpress.com/2010/12/05/introduction-to-memory-management-on-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fe322488701d50730f07f91b9689a718?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ferasferas</media:title>
		</media:content>
	</item>
		<item>
		<title>Linear Programming Model and it&#8217;s Applications</title>
		<link>http://ferasferas.wordpress.com/2010/11/26/linear-programming-model-and-its-applications/</link>
		<comments>http://ferasferas.wordpress.com/2010/11/26/linear-programming-model-and-its-applications/#comments</comments>
		<pubDate>Fri, 26 Nov 2010 21:36:19 +0000</pubDate>
		<dc:creator>ferasferas</dc:creator>
				<category><![CDATA[Math & Algorithms]]></category>

		<guid isPermaLink="false">http://ferasferas.wordpress.com/?p=324</guid>
		<description><![CDATA[&#62; Contents of the Article: What is Linear Programming ?. Applications of Linear Programming. An Example. Geometric Representation. Refrences. What is Linear Programming (LP) ? it is a mathematical method for determining a way to achieve the best outcome (such as maximum profit or lowest cost) in a given mathematical model for some list of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ferasferas.wordpress.com&amp;blog=7413391&amp;post=324&amp;subd=ferasferas&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>&gt; Contents of the Article:</p>
<ul>
<li>What is Linear Programming ?.</li>
<li>Applications of Linear 	Programming.</li>
<li>An Example.</li>
<li>Geometric Representation.</li>
<li>Refrences.</li>
</ul>
<p><strong>What is Linear Programming (LP) ? </strong>it is a mathematical method for determining a way to achieve the best outcome (such as maximum profit or lowest cost) in a given <a href="http://en.wikipedia.org/wiki/Mathematical_model">mathematical model</a> for some list of requirements represented as linear relationships.</p>
<p><a href="http://ferasferas.files.wordpress.com/2010/11/2.png"><img class="aligncenter size-full wp-image-327" title="2" src="http://ferasferas.files.wordpress.com/2010/11/2.png?w=163&#038;h=51" alt="" width="163" height="51" /></a></p>
<p>where <strong>x</strong> represents the vector of variables (to be determined), <strong>c</strong> and <strong>b</strong> are vectors of (known) coefficients and <em>A</em> is a (known) matrix of coefficients. The expression to be maximized or minimized is called the <em>objective function</em> (<strong>c</strong><sup>T</sup><strong>x</strong> in this case).</p>
<p><strong>Applications of Linear Programming </strong> arose as a mathematical model developed during <a href="http://en.wikipedia.org/wiki/World_War_II">World War II</a> to plan expenditures and returns in order to reduce costs to the army and increase losses to the enemy. It was kept secret until 1947. Postwar, many industries found its use in their daily planning.</p>
<p>The founders of the subject are <a href="http://en.wikipedia.org/wiki/Leonid_Kantorovich">Leonid Kantorovich</a>, a Russian mathematician who developed linear programming problems in 1939, <a href="http://en.wikipedia.org/wiki/George_Dantzig">George B. Dantzig</a>, who published the <a href="http://en.wikipedia.org/wiki/Simplex_algorithm">simplex method</a> in 1947, and <a href="http://en.wikipedia.org/wiki/John_von_Neumann">John von Neumann</a>, who developed the theory of the <a href="http://en.wikipedia.org/wiki/Linear_programming#Duality">duality</a> in the same year.</p>
<p><strong>Application in AI programming</strong> and in particular in Planning like <a href="http://www.cs.ubc.ca/~wolf/papers/web-ijcai99/">LPSAT</a> wich is used in Resource Planing. It is essentially a propositional conjunctive normal form(CNF) that includes linear (in)equalities as propositions. When SAT solver returns the propositions that are satisfiable the linear programming solver is used to get the value of the arithmetic (in)equalities.</p>
<p><strong>An Example </strong>taken from <a onclick="return mugicPopWin(this,event);" oncontextmenu="mugicRightClick(this);" href="http://www.amazon.com/Introduction-Algorithms-Second-Thomas-Cormen/dp/0262032937">Introduction to Algorithms</a> named “A political problem”.</p>
<p><strong>Problem</strong>: you are a politician trying to win the election. You have three districts Urban, Sub-Urban, Rureal. Each contains 100,  200,  50, registered vote. To win the elections your primary issues in your program are “build-roads”, “gun-control”, “farm-subsidies” and “gasoline-tax”.</p>
<p>Your researchers gave you a table for the effects of paying 1$ on each issue, how many votes you will win and how many will you lose for each urban.</p>
<table border="1" cellspacing="0" cellpadding="4" width="100%">
<col width="92*"></col>
<col width="57*"></col>
<col width="54*"></col>
<col width="53*"></col>
<tbody>
<tr valign="TOP">
<td width="36%">Policy</td>
<td width="22%">urban</td>
<td width="21%">suburban</td>
<td width="21%">rural</td>
</tr>
<tr valign="TOP">
<td width="36%">build-roads</td>
<td width="22%">-2</td>
<td width="21%">5</td>
<td width="21%">3</td>
</tr>
<tr valign="TOP">
<td width="36%">gun-control</td>
<td width="22%">8</td>
<td width="21%">2</td>
<td width="21%">-5</td>
</tr>
<tr valign="TOP">
<td width="36%">farm-subsidies</td>
<td width="22%">0</td>
<td width="21%">0</td>
<td width="21%">10</td>
</tr>
<tr valign="TOP">
<td width="36%">gasoline-tax</td>
<td width="22%">10</td>
<td width="21%">0</td>
<td width="21%">-2</td>
</tr>
</tbody>
</table>
<p>So inorder to win the election you decided that you need at least 50 votes, 100 votes, 25 votes respectively.</p>
<p><strong>Solution Approach: </strong>let&#8217;s model each inequality</p>
<p>x1: amounts of dollars spent on “build-roads”</p>
<p>x2: amounts of dollars spent on “gun-control”</p>
<p>x3: amounts of dollars spent on “farm-subsidies”</p>
<p>x4: amounts of dollars spent on “gasoline-tax”</p>
<p>minimize 	x1 + x2 + x3 + x4</p>
<p>subject to</p>
<p>-2 * x1 + 8 * x2 + 0 * x3 + 10 * x4  &gt;= 50     ( 1 )</p>
<p>5 * x1 + 2 * x2 + 0 * x3 +   0 * x4  &gt;= 100   ( 2 )</p>
<p>3 * x1 + -5 * x2 +10 * x3 + -2 * x4  &gt;= 25    ( 3 )</p>
<p>x1, x2, x3, x4 &gt;= 0 				 ( 4 )</p>
<p><strong>Geometric Representation </strong>is very important to understand linear programming more in depth, but inorder to be easy on geometric representation we will define another example with only two variables.</p>
<p>maximize 	x1 + x2</p>
<p>subject to</p>
<p>5 * x1 &#8211;  2 * x2   &gt;=  -2       ( 1 )</p>
<p>2 * x1 +       x2   &lt;= 10       ( 2 )</p>
<p>4 * x1  &#8211;        x2    &lt;= 8        ( 3 )</p>
<p>x1, x2     &gt;= 0 		         ( 4 )</p>
<p><a href="http://ferasferas.files.wordpress.com/2010/11/11.png"><img class="alignleft size-full wp-image-330" title="1" src="http://ferasferas.files.wordpress.com/2010/11/11.png?w=251&#038;h=226" alt="" width="251" height="226" /></a></p>
<p>The Feasible area of solution is defined as the set of points that solve the 5 equations defined(shaded region).</p>
<p><strong>References</strong></p>
<p><strong> </strong><a onclick="return mugicPopWin(this,event);" oncontextmenu="mugicRightClick(this);" href="http://www.amazon.com/Introduction-Algorithms-Second-Thomas-Cormen/dp/0262032937">Introduction to Algorithms(CLRS), 2</a><a onclick="return mugicPopWin(this,event);" oncontextmenu="mugicRightClick(this);" href="http://www.amazon.com/Introduction-Algorithms-Second-Thomas-Cormen/dp/0262032937"><sup>nd</sup></a><a onclick="return mugicPopWin(this,event);" oncontextmenu="mugicRightClick(this);" href="http://www.amazon.com/Introduction-Algorithms-Second-Thomas-Cormen/dp/0262032937"> edition (Chapter 29).</a></p>
<p>Wikipedia.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ferasferas.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ferasferas.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ferasferas.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ferasferas.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ferasferas.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ferasferas.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ferasferas.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ferasferas.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ferasferas.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ferasferas.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ferasferas.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ferasferas.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ferasferas.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ferasferas.wordpress.com/324/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ferasferas.wordpress.com&amp;blog=7413391&amp;post=324&amp;subd=ferasferas&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ferasferas.wordpress.com/2010/11/26/linear-programming-model-and-its-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fe322488701d50730f07f91b9689a718?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ferasferas</media:title>
		</media:content>

		<media:content url="http://ferasferas.files.wordpress.com/2010/11/2.png" medium="image">
			<media:title type="html">2</media:title>
		</media:content>

		<media:content url="http://ferasferas.files.wordpress.com/2010/11/11.png" medium="image">
			<media:title type="html">1</media:title>
		</media:content>
	</item>
		<item>
		<title>Introducing &#8211; &#8220;On-line Planning for Resource Production in RTS&#8221;</title>
		<link>http://ferasferas.wordpress.com/2010/10/31/introducing-on-line-planning-for-resource-production-in-rts/</link>
		<comments>http://ferasferas.wordpress.com/2010/10/31/introducing-on-line-planning-for-resource-production-in-rts/#comments</comments>
		<pubDate>Sun, 31 Oct 2010 18:20:03 +0000</pubDate>
		<dc:creator>ferasferas</dc:creator>
				<category><![CDATA[AI]]></category>

		<guid isPermaLink="false">http://ferasferas.wordpress.com/?p=318</guid>
		<description><![CDATA[On-line Planning for Resource Production in Real-Time Strategy Games Hei Chan, Alan Fern, Soumya Ray, Nick Wilson and Chris Ventura School of Electrical Engineering and Computer Science Oregon State University Corvallis, OR 97330 {chanhe,afern,sray,wilsonic,ventura}@eecs.oregonstate.edu &#160; Goal : Develop action-selection mechanism in producing certain amount of resources as fast as possible. Planner : Computationally efficient “action-selection” [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ferasferas.wordpress.com&amp;blog=7413391&amp;post=318&amp;subd=ferasferas&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:center;"><span style="font-size:medium;"><strong>On-line Planning for Resource Production in Real-Time Strategy Games</strong></span></p>
<p style="text-align:center;"><strong> Hei Chan, Alan Fern, Soumya Ray, Nick Wilson and Chris Ventura </strong></p>
<p style="text-align:center;"><strong> School of Electrical Engineering and Computer Science </strong></p>
<p style="text-align:center;"><strong> Oregon State University </strong></p>
<p style="text-align:center;"><strong>Corvallis, OR 97330 </strong></p>
<p style="text-align:center;"><strong>{chanhe,afern,sray,wilsonic,ventura}@eecs.oregonstate.edu</strong></p>
<p style="text-align:center;">&nbsp;</p>
<p><span style="font-size:small;"><strong>Goal :</strong></span></p>
<p><span style="font-size:small;"> Develop action-selection mechanism in producing certain amount of resources as fast as </span><span style="font-size:small;">possible.</span></p>
<p><span style="font-size:small;"><strong>Planner : </strong></span></p>
<p><span style="font-size:small;"> Computationally efficient “action-selection” mechanism which at each epoch creates a possibly </span><span style="font-size:small;">Sub-Optimal concurrent plan from the current state to the goal, then begin executing the set of </span><span style="font-size:small;">initial actions.</span></p>
<p><span style="font-size:small;"><strong>How it&#8217;s done :</strong></span></p>
<p><span style="font-size:small;"> formed via a combination of MEA(means-ends-analysis) and Scheduling and Bounded Search </span><span style="font-size:small;">over sub-goals that aren&#8217;t required for goal achievements but may improve the make span.</span></p>
<p><span style="font-size:small;"><strong>Two Key problem domains :</strong></span></p>
<p><span style="font-size:small;"> -Resource production and tactical battles.</span></p>
<p><span style="font-size:small;"> <strong>In Resource Production :</strong> player has to produce ( or gather ) varies raw materials, buildings, </span><span style="font-size:small;">civilian and military Units to improve their economic and military power.</span></p>
<p><span style="font-size:small;"> <strong>Tactical Battles : </strong>a player uses military units to gain territory and defeat enemy Units </span><span style="font-size:small;">( offensive or defensive actions ).</span></p>
<p style="text-align:center;"><span style="text-decoration:underline;"><strong><span style="font-size:small;"> “Winning the Resource Production race is often a key factor in overall success”.</span></strong></span></p>
<p><span style="font-size:small;"><strong>Uses :</strong></span></p>
<p><span style="font-size:small;"> 1- either in computer opponent A.I.</span></p>
<p><span style="font-size:small;"> 2- Human can use it to specify resources needed and the Planner will get the best way to get this </span><span style="font-size:small;">“RTS resource production is interesting from a pure A.I. Planning perspective as it encompasses </span><span style="font-size:small;">a number of challenging issues”.</span></p>
<p><span style="font-size:small;"><strong>First</strong>, resource production involves temporal actions with numeric effects.</span></p>
<p><span style="font-size:small;"><strong>Second</strong>, performing well in this task requires highly concurrent activity.</span></p>
<p><span style="font-size:small;"><strong>Third</strong>, real-time constraints of the problem require action selection be computational efficient in a </span><span style="font-size:small;">practical sense.</span></p>
<p><span style="font-size:small;"><strong>Why?</strong> :</span></p>
<p><span style="font-size:small;"> Most existing planners are :</span></p>
<p><span style="font-size:small;"> 1- not handling temporal and numerical domains.</span></p>
<p><span style="font-size:small;"> 2- simply too inefficient to be useful.</span></p>
<p><span style="font-size:small;"> 3-  produce highly Sub-Optimal plans.</span></p>
<p><span style="font-size:small;"> </span></p>
<p style="text-align:center;"><span style="text-decoration:underline;"><strong><span style="font-size:small;">The planning component used by online planner is based on a combination of means-ends analysis (MEA) and  scheduling. </span></strong></span></p>
<p style="text-align:center;">&nbsp;</p>
<p><span style="font-size:small;">Given an initial state and resource goal, is used to compute a sequential plan that reaches the goal using the minimum number of actions and resources in sense that any valid plan must include all of the actions in the  MEA plan. </span></p>
<p><span style="font-size:small;">Importantly, the special structure of our domain  guarantees that MEA will produce such a plan and do so efficiently (linear time in the plan length).</span></p>
<p><span style="font-size:small;">Given the minimum  sequential plan, we then reschedule those actions, allowing  for concurrency, in an attempt to minimize the make span. This scheduling step is computationally hard, however, we  have found that simple worst-case quadratic time heuristic  methods work quite well. Thus both the MEA step and  scheduling step are both low-order polynomial operations  in the minimum number of actions required to achieve the  goal, allowing for real-time efficiency.</span></p>
<p><strong>Refrences :</strong></p>
<p>MEA( means-ends analysis) : <a href="http://en.wikipedia.org/wiki/Means-ends_analysis">http://en.wikipedia.org/wiki/Means-ends_analysis</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ferasferas.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ferasferas.wordpress.com/318/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ferasferas.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ferasferas.wordpress.com/318/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ferasferas.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ferasferas.wordpress.com/318/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ferasferas.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ferasferas.wordpress.com/318/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ferasferas.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ferasferas.wordpress.com/318/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ferasferas.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ferasferas.wordpress.com/318/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ferasferas.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ferasferas.wordpress.com/318/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ferasferas.wordpress.com&amp;blog=7413391&amp;post=318&amp;subd=ferasferas&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ferasferas.wordpress.com/2010/10/31/introducing-on-line-planning-for-resource-production-in-rts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fe322488701d50730f07f91b9689a718?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ferasferas</media:title>
		</media:content>
	</item>
		<item>
		<title>OCBP – “Introducing Darmok” part4</title>
		<link>http://ferasferas.wordpress.com/2010/10/30/ocbp-%e2%80%93-%e2%80%9cintroducing-darmok%e2%80%9d-part4/</link>
		<comments>http://ferasferas.wordpress.com/2010/10/30/ocbp-%e2%80%93-%e2%80%9cintroducing-darmok%e2%80%9d-part4/#comments</comments>
		<pubDate>Sat, 30 Oct 2010 10:20:16 +0000</pubDate>
		<dc:creator>ferasferas</dc:creator>
				<category><![CDATA[AI]]></category>

		<guid isPermaLink="false">http://ferasferas.wordpress.com/?p=311</guid>
		<description><![CDATA[On-Line Plan Expansion and Execution During execution, the plan expansion, plan execution and plan adaptation occur in parallel in order to maintain a current partial plan tree that the system is executing. A partial plan tree (or simply the “plan”) is represented as a tree consisting of two types of nodes: goals and snippets. Initially, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ferasferas.wordpress.com&amp;blog=7413391&amp;post=311&amp;subd=ferasferas&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } --> <!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } --></p>
<p style="text-align:center;"><span style="font-size:small;"><strong><span style="font-size:medium;"><strong>On-Line Plan Expansion and Execution</strong></span></strong></span></p>
<p><!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } --><span style="font-size:small;">During execution, the plan expansion, plan execution and plan adaptation occur in parallel in order to maintain a current partial plan tree that the system is executing. A partial plan tree (or simply the “plan”) is represented as a tree consisting of two types of nodes: goals and snippets.</span></p>
<p><span style="font-size:small;">Initially, the plan consists of a single goal corresponding to the planning task at hand. In particular, in Darmok the initial goal is always “win the game”. Then, the plan expansion module asks the plan retrieval module to retrieve a snippet for that goal. That snippet might have several subgoals, for which the plan expansion module will again ask the plan retrieval module to retrieve snippets, and so on. For instance, at the top of Figure 8 we can see a sample plan, where the top goal is to “win”. The snippet assigned to the “win” goal has  three subgoals, namely “build base”, “build army” and “attack”. </span></p>
<p><a href="http://ferasferas.files.wordpress.com/2010/10/ocbp-5.png"><img class="aligncenter size-full wp-image-314" title="OCBP-5" src="http://ferasferas.files.wordpress.com/2010/10/ocbp-5.png?w=550&#038;h=331" alt="" width="550" height="331" /></a></p>
<p><span style="font-size:small;">Figure 9 shows the algorithm the plan expansion module executes at every</span><span style="font-size:small;"> execution cycle given a plan p and a game state S. The plan expansion module is constantly querying the current plan to see if there is a ready open goal. When this happens, the open goal is sent to the plan retrieval module to retrieve a snippet for it. Then, that snippet is sent to the plan adaptation module, and then inserted in the current plan, marked as pending. </span></p>
<p style="text-align:left;padding-left:90px;"><span style="font-size:small;">Function PlanExpansion(p, S) </span><span style="font-size:small;"> </span></p>
<p style="text-align:left;padding-left:90px;"><span style="font-size:small;">G = GetReadyOpenGoals(p) </span><span style="font-size:small;"> </span></p>
<p style="text-align:left;padding-left:90px;"><span style="font-size:small;">For g ∈ G Do </span><span style="font-size:small;"> </span></p>
<p style="text-align:left;padding-left:90px;"><span style="font-size:small;">pg = RetrievePlan(g, S) </span><span style="font-size:small;"> </span></p>
<p style="text-align:left;padding-left:90px;"><span style="font-size:small;">pg = AdaptPlan(pg , g, S) </span><span style="font-size:small;"> </span></p>
<p style="text-align:left;padding-left:90px;"><span style="font-size:small;">p = InsertSnippetInPlan(p, g, pg ) </span><span style="font-size:small;"> </span></p>
<p style="text-align:left;padding-left:90px;"><span style="font-size:small;">EndFor </span><span style="font-size:small;"> </span></p>
<p style="text-align:left;padding-left:90px;"><span style="font-size:small;">Return p </span><span style="font-size:small;"> </span></p>
<p style="text-align:left;padding-left:90px;"><span style="font-size:small;">EndFunction </span><span style="font-size:small;"> </span></p>
<p style="text-align:left;padding-left:90px;"><span style="font-size:small;"><strong>Figure 9</strong>: Plan expansion algorithm used in Darmok, where p is the current plan </span></p>
<p><span style="font-size:small;"><br />
</span></p>
<p style="padding-left:90px;"><span style="font-size:small;">Function PlanExecution(p, S) </span></p>
<p style="padding-left:90px;"><span style="font-size:small;">p = startReadySnippets(p,S) </span></p>
<p style="padding-left:90px;"><span style="font-size:small;">p = sendActionsToExecution(p,S) </span></p>
<p style="padding-left:90px;"><span style="font-size:small;">p = updateSnippetStatus(p,S) </span></p>
<p style="padding-left:90px;"><span style="font-size:small;">p = updateActionStatus(p,S) </span></p>
<p style="padding-left:90px;"><span style="font-size:small;">Return p </span></p>
<p style="padding-left:90px;"><span style="font-size:small;">EndFunction </span></p>
<p style="padding-left:90px;"><span style="font-size:small;"><strong>Figure 10</strong>: Plan execution algorithm used in Darmok, where p is the current plan and S is the current game state. </span></p>
<p style="padding-left:90px;"><span style="font-size:small;"><br />
</span></p>
<p>Figure 10  shows the algorithm that the plan execution module executes at each  execution cycle, composed of four steps:</p>
<p>•<strong> startReadySnippets:</strong> For each pending snippet, the execution  module evaluates the preconditions, and as soon as they are met, the  snippet starts its execution. If the current game state  has changed since the time the and S is the current game state. plan  retrieval module retrieved it, the snippet is handed back to  the plan  adaptation module to make sure that the plan is adequate for  the current  game state.</p>
<p>• <span style="font-size:small;"><strong>sendActionsToExecution:</strong> If any of the executing snippets have any basic actions, and those actions have all its preconditions satisfied, then they are sent to Wargus to be executed. If the preconditions of the actions are not satisfied, the snippet is sent back to the plan adaptation module to see if the plan can be repaired. If after a certain amount of time t1 (set to 2000 game cycles in our experiments) it cannot, then the snippet is marked as failed, and thus its corresponding goal is open again (thus, the system will have to find another plan for that goal). </span></p>
<p>• <span style="font-size:small;"><strong>updateSnippetStatus: </strong>The execution module periodically evaluates the alive conditions and success conditions of each snippet. If the alive conditions of an executing snippet are not satisfied, the snippet is marked as failed, and its goal is open again. If the success conditions of a snippet are satisfied, the snippet is marked as succeeded. </span></p>
<p><strong>• </strong><span style="font-size:small;"><strong>updateActionStatus:</strong> Whenever a basic action succeeds or fails, the execution module updates the status of the snippet that contained it. When a basic action succeeds, the executing snippet can continue to the next step. When a basic action fails, the snippet is marked as failed, and thus its corresponding goal is open again. </span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ferasferas.wordpress.com/311/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ferasferas.wordpress.com/311/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ferasferas.wordpress.com/311/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ferasferas.wordpress.com/311/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ferasferas.wordpress.com/311/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ferasferas.wordpress.com/311/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ferasferas.wordpress.com/311/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ferasferas.wordpress.com/311/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ferasferas.wordpress.com/311/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ferasferas.wordpress.com/311/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ferasferas.wordpress.com/311/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ferasferas.wordpress.com/311/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ferasferas.wordpress.com/311/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ferasferas.wordpress.com/311/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ferasferas.wordpress.com&amp;blog=7413391&amp;post=311&amp;subd=ferasferas&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ferasferas.wordpress.com/2010/10/30/ocbp-%e2%80%93-%e2%80%9cintroducing-darmok%e2%80%9d-part4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fe322488701d50730f07f91b9689a718?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ferasferas</media:title>
		</media:content>

		<media:content url="http://ferasferas.files.wordpress.com/2010/10/ocbp-5.png" medium="image">
			<media:title type="html">OCBP-5</media:title>
		</media:content>
	</item>
		<item>
		<title>OCBP – “Introducing Darmok” part3</title>
		<link>http://ferasferas.wordpress.com/2010/10/30/ocbp-%e2%80%93-%e2%80%9cintroducing-darmok%e2%80%9d-part3/</link>
		<comments>http://ferasferas.wordpress.com/2010/10/30/ocbp-%e2%80%93-%e2%80%9cintroducing-darmok%e2%80%9d-part3/#comments</comments>
		<pubDate>Sat, 30 Oct 2010 10:08:39 +0000</pubDate>
		<dc:creator>ferasferas</dc:creator>
				<category><![CDATA[AI]]></category>

		<guid isPermaLink="false">http://ferasferas.wordpress.com/?p=298</guid>
		<description><![CDATA[Plan Retrieval To solve a complex planning task, several subproblems have to be solved. For instance, in our domain, the system has to solve problems such as how to build a proper base, how to gather the necessary resources, or how to destroy each of the units of the enemy. The propose to organize the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ferasferas.wordpress.com&amp;blog=7413391&amp;post=298&amp;subd=ferasferas&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } --></p>
<p style="text-align:center;"><span style="font-size:medium;"><strong>Plan Retrieval</strong></span></p>
<p><span style="font-size:small;">To solve a complex planning task, several subproblems have to be solved. For instance, in our domain, the system has to solve problems such as how to build a proper base, how to gather the necessary resources, or how to destroy each of the units of the enemy. </span> <strong><span style="font-size:small;"> </span></strong></p>
<p><strong><span style="font-size:small;">The propose to organize the case base using two kinds of elements:</span></strong></p>
<p>• <span style="font-size:small;">Snippets: a snippet is a procedure composed of a collection of actions,</span><span style="font-size:small;"> and subgoals composed in sequence or parallel. </span><span style="font-size:small;"> </span></p>
<p>• <span style="font-size:small;">Episodes: an episode is a tuple e = ( p, G, S, O ) where e.p is a snippet, e.G</span><span style="font-size:small;"> is a goal, e.S is a situation (i.e. a game state), and e.O is the outcome</span><span style="font-size:small;"> of applying e.p in e.S to achieve e.G. In particular e.O is a real number</span><span style="font-size:small;"> between 0 and 1 representing  how well the snippet achieved its goal in the situation e.S.</span></p>
<p><span style="font-size:small;"> </span> <a href="http://ferasferas.files.wordpress.com/2010/10/ocbp-screenshot-3.png"><img class="aligncenter size-full wp-image-299" title="OCBP-Screenshot-3" src="http://ferasferas.files.wordpress.com/2010/10/ocbp-screenshot-3.png?w=550&#038;h=289" alt="" width="550" height="289" /></a> <strong>Figure. 7</strong> <span style="font-size:small;">Figure 7 shows an example of a snippet with an associated episode, with the four elements: a goal (in this case, building the resource infrastructure of player “1”) a procedure to achieve the specified goal in the given map in the snippet, a game state (with general features about the map and information about each players) and the outcome for the episode. In particular, in Darmok, the game state is defined by 35 features that represent the state of a Wargus game. Twelve features represent the number of troops (number of fighters, number of peasants, and so on), four represent the resources the player owns (gold, oil, wood and food), fourteen represent the number of the buildings (number of town halls, number of barracks, and so on) and finally, five features represent the map (size in both dimensions, percentage of water, percentage of trees, number of gold mines). </span> <span style="font-size:small;"> </span></p>
<p><span style="font-size:small;">Given a game state and a goal to retrieve the snippet which could have the highest performance in such a goal in the given game state. To predict the performance of a snippet p, the plan retrieval module uses the episodes in the case base associated with p. To retrieve episodes, Darmok uses the episode relevance measure ER(e, S, G) that computes the relevance of a given episode e given the current game state S and goal G, and is defined as: </span> <span style="font-size:small;"><a href="http://ferasferas.files.wordpress.com/2010/10/screenshot-12.png"><img class="aligncenter size-full wp-image-300" title="Screenshot-1" src="http://ferasferas.files.wordpress.com/2010/10/screenshot-12.png?w=550&#038;h=61" alt="" width="550" height="61" /></a> </span> <span style="font-size:small;">where GS is the goal similarity of the goal in the snippet p and the goal G, and SS is the state similarity. α is a parameter that has been set to 0.75 in experiments. The distance between two goals g1 = name1 (p1 , &#8230;, pn ) and g2 = name2 (q1 , &#8230;, qm ) is measured</span><span style="font-size:small;"> as follows:</span> <span style="font-size:small;"><a href="http://ferasferas.files.wordpress.com/2010/10/screenshot-21.png"><img class="aligncenter size-full wp-image-305" title="Screenshot-2" src="http://ferasferas.files.wordpress.com/2010/10/screenshot-21.png?w=550&#038;h=89" alt="" width="550" height="89" /></a> </span> <span style="font-size:small;">where Pi is the maximum value that the parameter i of a goal might take (we assume that all the parameters have positive values). Thus, when name1 = name2 , the two goals will always have the same number of parameters and the distance can be computed using an Euclidean distance among the parameters. The distance is maximum (1) otherwise. </span> <span style="font-size:small;"> </span></p>
<p><span style="font-size:small;">SS(gs1 , gs2 ) computes the similarity between two given game states, and returns a number between 0 and 1 (where 0 means identical, and 1 means totally different). SS is computed as the inverse of a simple Euclidean distance among the game states, where each feature is normalized between 0 and 1. </span></p>
<p><span style="font-size:small;">Finally, to predict the performance of a snippet, we define the set of relevant episodes RE(p, S, G) = {e1 , &#8230;, ek }, as the set of k episodes associated with the snippet p, and that have the maximum relevance ER. In our experiments, Darnok have set k ≤ 5, i.e. if there is fewer or equal to 5 episodes associated with p in the case base, then RE(p, S, G) contains all of them, but if there is more than 5, then only the best 5 are included in RE(p, S, G). Using that definition we can now define the predicted performance of a snippet as:</span> <a href="http://ferasferas.files.wordpress.com/2010/10/screenshot-21.png"> </a> <span style="font-size:small;"> </span></p>
<p><a href="http://ferasferas.files.wordpress.com/2010/10/screenshot-31.png"><img class="aligncenter size-full wp-image-307" title="Screenshot-3" src="http://ferasferas.files.wordpress.com/2010/10/screenshot-31.png?w=550&#038;h=90" alt="" width="550" height="90" /></a></p>
<p><span style="font-size:small;">The predicted performance is a weighted average of the outcomes that snippet p has had in similar game states to S for similar goals. We add 1 to the numerator and 2 to the denominator following the Laplace probability estimation rule (which biases the predicted performance towards 0.5 when </span> <span style="font-size:small;">the number of episodes we have to predict the performance is small.) </span> <span style="font-size:small;">The result of the retrieval process is the snippet p that has the highest predicted performance P P (p, S, G), i.e. the snippet that has had the best performance in the past for similar goals in a similar game state. </span><span style="font-size:small;"> </span> <span style="font-size:small;">The snippet retrieved then needs to go through the adaptation process. </span></p>
<p><span style="font-size:small;">However, real-time domains require delayed adaptation.The game state changes with time and it is important that adaptation is done with the most up to date game state (ideally with the game state just before the snippet starts execution). For that reason, in Darmok, when the plan execution module is just about to start the execution of a particular snippet, the snippet is sent to the plan adaptation module for adaptation. Darmok cannot guarantee that the snippet is adapted with the latest game state since in a real-time domain the domain changes continuously, however, delaying adaptation as much as possible minimizes the adaptation error of Darmok. </span></p>
<p><span style="font-size:small;"><br />
</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ferasferas.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ferasferas.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ferasferas.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ferasferas.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ferasferas.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ferasferas.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ferasferas.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ferasferas.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ferasferas.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ferasferas.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ferasferas.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ferasferas.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ferasferas.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ferasferas.wordpress.com/298/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ferasferas.wordpress.com&amp;blog=7413391&amp;post=298&amp;subd=ferasferas&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ferasferas.wordpress.com/2010/10/30/ocbp-%e2%80%93-%e2%80%9cintroducing-darmok%e2%80%9d-part3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fe322488701d50730f07f91b9689a718?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ferasferas</media:title>
		</media:content>

		<media:content url="http://ferasferas.files.wordpress.com/2010/10/ocbp-screenshot-3.png" medium="image">
			<media:title type="html">OCBP-Screenshot-3</media:title>
		</media:content>

		<media:content url="http://ferasferas.files.wordpress.com/2010/10/screenshot-12.png" medium="image">
			<media:title type="html">Screenshot-1</media:title>
		</media:content>

		<media:content url="http://ferasferas.files.wordpress.com/2010/10/screenshot-21.png" medium="image">
			<media:title type="html">Screenshot-2</media:title>
		</media:content>

		<media:content url="http://ferasferas.files.wordpress.com/2010/10/screenshot-31.png" medium="image">
			<media:title type="html">Screenshot-3</media:title>
		</media:content>
	</item>
		<item>
		<title>OCBP – “Introducing Darmok” part2</title>
		<link>http://ferasferas.wordpress.com/2010/10/29/ocbp-%e2%80%93-%e2%80%9cintroducing-darmok%e2%80%9d-part2/</link>
		<comments>http://ferasferas.wordpress.com/2010/10/29/ocbp-%e2%80%93-%e2%80%9cintroducing-darmok%e2%80%9d-part2/#comments</comments>
		<pubDate>Fri, 29 Oct 2010 15:06:22 +0000</pubDate>
		<dc:creator>ferasferas</dc:creator>
				<category><![CDATA[AI]]></category>

		<guid isPermaLink="false">http://ferasferas.wordpress.com/?p=291</guid>
		<description><![CDATA[Plan Acquisition The propose to acquire such cases by analyzing game traces. In Darmok, this is done in two processes : trace annotation (revision) and case learning. 1- Trace Annotation(Revision) : Annotation consists of associating which goals were being pursued by each of the actions executed by the expert. Annotation is needed because if the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ferasferas.wordpress.com&amp;blog=7413391&amp;post=291&amp;subd=ferasferas&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } --></p>
<p><!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } --></p>
<p style="text-align:center;"><span style="font-size:medium;"><strong><span style="font-size:medium;">Plan Acquisition</span></strong></span></p>
<p><!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } --><span style="font-size:small;">The propose to acquire such cases by analyzing game traces. In Darmok, this is done in two processes : trace annotation (revision) and case learning. </span></p>
<p><span style="font-size:small;">1- <strong>Trace Annotation(Revision) </strong>:</span></p>
<p><span style="font-size:small;">Annotation consists of associating which goals were being pursued by each of the  actions executed by the expert. Annotation is needed because if the system was  to learn snippets simply by observing a human play, it will need to implement  plan recognition techniques in order to identify what the human is intending  to do at every moment. Thus, annotations provide a way to avoid complex  plan recognition techniques.</span></p>
<p><span style="font-size:small;">In approach, a goal g = name(p1 , &#8230;, pn ) consists of a goal name and a  set of parameters. For instance, in Wargus, these are some of the goal types  defined: </span></p>
<p>• <span style="font-size:small;">WinGame(player): representing that the action had the intention of making the player win the game. </span></p>
<p>• <span style="font-size:small;">KillUnit(unit): representing that the action had the intention of killing the unit unit. </span></p>
<p>• <span style="font-size:small;">Resources(gold, wood, oil): the action had the intention of increasing the resource levels to at least the specified levels in the parameters. </span></p>
<p>• <span style="font-size:small;">SetupResourceInfrastructure(player, peasants, farms): indicates that the expert wanted to create a good resource infrastructure for player , that at least included peasants number of peasants and farms number of farms. </span></p>
<p><span style="font-size:small;"><a href="http://ferasferas.files.wordpress.com/2010/10/ocbp-planaq-1.png"><img class="aligncenter size-full wp-image-293" title="OCBP-PlanAq-1" src="http://ferasferas.files.wordpress.com/2010/10/ocbp-planaq-1.png?w=550&#038;h=315" alt="" width="550" height="315" /></a></span></p>
<p><!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } --><span style="font-size:small;">The fourth column of Table 1 shows the annotations that the expert specified  for his actions. Since the snippet shown corresponds to the beginning of the  game, the expert specified that he was trying to create a resource infrastructure  and, of course, he was trying to win the game. </span></p>
<p><span style="font-size:small;">2- <strong>Case Learning</strong> : </span></p>
<p><span style="font-size:small;">The annotated trace is processed by the case  learning module, that encodes the strategy of the expert in this particular trace  in a series of cases. Traditionally, in the CBR literature cases consist of a problem/solution pair; in Darmok system the case base is composed of two structures: snippets and episodes. </span></p>
<p><span style="font-size:small;"><strong>Snippet and Episodes :</strong></span></p>
<p><span style="font-size:small;">A snippet stores just a plan, and an episode stores the  outcome of having applied a particular snippet in a particular context to achieve  a particular goal. </span></p>
<p><span style="font-size:small;">The case learning module analyzes the annotated trace to determine the temporal relations among the individual goals appearing in the trace. For instance, if we look at the sample annotated trace in Figure 6, we can see that the  goal g2 was attempted before the goal g3, and that the goal g3 was attempted in parallel with the goal g4. </span></p>
<p><span style="font-size:small;">In Daemok framework, we  want to know if two goals are pursued in sequence, in parallel,  or if one is a subgoal of the other. Darmok determines those relations in the following way:</span></p>
<p><span style="font-size:small;"> </span></p>
<p>• <span style="font-size:small;">If most (90%) of the actions associated with a goal g1 happen before the first action of another goal g2 , then g1 and g2 are considered to happen in  sequence. </span></p>
<p>• <span style="font-size:small;">If all the actions associated with a goal g1 are also associated with another goal g2 and the goal g2 has some action not associated with g1, then g1 is considered to be a subgoal of g2. </span></p>
<p>• <span style="font-size:small;">Otherwise, two goals are considered to be in parallel. </span></p>
<p><span style="font-size:small;"><a href="http://ferasferas.files.wordpress.com/2010/10/ocbp-planaq-2.png"><img class="aligncenter size-full wp-image-294" title="OCBP-PlanAq-2" src="http://ferasferas.files.wordpress.com/2010/10/ocbp-planaq-2.png?w=550&#038;h=329" alt="" width="550" height="329" /></a></span></p>
<p><!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } --><span style="font-size:small;">The cases learned consist only of the procedural information in  the snippets and a goal, game state and outcome in the episodes, as Figure 7  shows. </span></p>
<p><span style="font-size:small;"><br />
</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ferasferas.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ferasferas.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ferasferas.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ferasferas.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ferasferas.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ferasferas.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ferasferas.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ferasferas.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ferasferas.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ferasferas.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ferasferas.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ferasferas.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ferasferas.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ferasferas.wordpress.com/291/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ferasferas.wordpress.com&amp;blog=7413391&amp;post=291&amp;subd=ferasferas&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ferasferas.wordpress.com/2010/10/29/ocbp-%e2%80%93-%e2%80%9cintroducing-darmok%e2%80%9d-part2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fe322488701d50730f07f91b9689a718?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ferasferas</media:title>
		</media:content>

		<media:content url="http://ferasferas.files.wordpress.com/2010/10/ocbp-planaq-1.png" medium="image">
			<media:title type="html">OCBP-PlanAq-1</media:title>
		</media:content>

		<media:content url="http://ferasferas.files.wordpress.com/2010/10/ocbp-planaq-2.png" medium="image">
			<media:title type="html">OCBP-PlanAq-2</media:title>
		</media:content>
	</item>
		<item>
		<title>OCBP &#8211; &#8220;Introducing Darmok&#8221;</title>
		<link>http://ferasferas.wordpress.com/2010/10/29/ocbp-introducing-darmok/</link>
		<comments>http://ferasferas.wordpress.com/2010/10/29/ocbp-introducing-darmok/#comments</comments>
		<pubDate>Fri, 29 Oct 2010 08:00:13 +0000</pubDate>
		<dc:creator>ferasferas</dc:creator>
				<category><![CDATA[AI]]></category>

		<guid isPermaLink="false">http://ferasferas.wordpress.com/?p=285</guid>
		<description><![CDATA[Reference Paper That Implemented Darmok System. &#160; Darmok Using designed OLCBP cycle has been designed with domains such as RTS games in mind. This approach has been implemented in the Darmok system, designed to play the full Wargus game. The only aspect of Wargus still not covered by Darmok is the “fog-of-war”, that has been [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ferasferas.wordpress.com&amp;blog=7413391&amp;post=285&amp;subd=ferasferas&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } --></p>
<p style="text-align:center;"><strong> <a href="http://ferasferas.wordpress.com/2010/10/28/on-line-case-based-planning/">Reference Paper That Implemented Darmok System.</a></strong></p>
<p style="text-align:center;">&nbsp;</p>
<p><!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } --></p>
<p style="text-align:center;"><span style="font-size:small;"><strong><span style="font-size:medium;">Darmok</span></strong></span></p>
<p>Using designed OLCBP cycle has been designed with domains such as RTS games in mind. This approach has been implemented in the Darmok system, designed to  play the full Wargus game. The only aspect of Wargus still not covered by  Darmok is the “fog-of-war”, that has been disabled in during experiments.</p>
<p>The Darmok system learns how to play Wargus by observing how humans play. Darmok learns what we call plan snippets by observing a human play, and stores those snippets in the system in the form of cases. Such snippets are then retrieved and composed together to form plans.</p>
<p>﻿<a href="http://ferasferas.files.wordpress.com/2010/10/ocbp-3.png"><img class="aligncenter size-full wp-image-288" title="OCBP-3" src="http://ferasferas.files.wordpress.com/2010/10/ocbp-3.png?w=550&#038;h=310" alt="" width="550" height="310" /></a></p>
<p><strong>Learning:</strong></p>
<p>During learning Darmok observes a game trace to learn plan snippets that will be stored in the case base. In experiments, an expert plays Wargus to generate a trace. However, notice that the system could learn from any trace, even from traces of itself playing, or observing other systems play. Then, the trace is annotated by the expert, explaining the goals he was pursuing with the actions he took while playing. Using those annotations, a set of snippets are extracted from the trace and stored as a set of cases. For each snippet, the situation in which it was executed, the goal it was pursuing, and its success or failure are stored in the case base.</p>
<p><strong>Execution:</strong></p>
<p>Plan Retrieval, Plan Adaptation, Plan Expansion and Plan Execution are in charge of maintaining a current plan to win the game. The Plan Execution module is in charge of executing the current plan, and update its state (e.g., marking which actions succeeded or failed). The Plan Expansion module is in charge of identifying open goals in the current plan and expand them. In order to do that it relies on the Plan Retrieval module, which given an open goal and the current game state retrieves the most appropriate plan snippet to fulfill the open goal. Finally, we have the Plan Adaptation module in charge of adapting the retrieved snippets according to the current game state.</p>
<p><strong>Darmok requires:</strong></p>
<p>1- a set of goals.</p>
<p>2- a set of primitive actions.</p>
<p>3- a vocabulary for conditions.</p>
<p>4- a set of features to represent the game state (used for plan retrieval).</p>
<p>5- a set of annotated expert traces.</p>
<p>6- and (as to be explained later) a set of rules to help the system perform precondition-postcondition matching.</p>
<p style="text-align:center;"><span style="font-size:medium;"><strong>Plan Representation in Darmok</strong></span></p>
<p>The plan representation formalism used by Darmok, designed to allow a system to learn plans, represent them, and to reason about them and their intended and actual effects.The basic constituent piece is the snippet. Snippets are composed of three elements:</p>
<p>• <strong>A set of preconditions</strong> that must be satisfied before the plan can be executed. For instance, a snippet can have as preconditions that a particular peasant exists and that a desired location is empty.</p>
<p>• <strong>A set of alive conditions</strong> that represent the conditions that must be satisfied during the execution of the plan for it to have chances of success (also known as “maintenance goals” in the planning literature). If at some moment during the execution, the alive conditions are not met, the plan can be stopped, since it will not achieve its intended goal. For instance, the peasant in charge of building a building must remain alive; if he is killed, the building will not be built.</p>
<p>• <strong>The plan itself</strong>. which can contain the following constructs: <span style="text-decoration:underline;">sequence</span>, <span style="text-decoration:underline;">parallel</span>, <span style="text-decoration:underline;">action</span>, and <span style="text-decoration:underline;">subgoal</span>, where an action represents the execution of a basic action in the domain of application (a set of basic actions must be defined for each domain), and a subgoal means that the execution engine must find another snippet that has to be executed to satisfy that particular subgoal.</p>
<p>Also, snippets are associated with goals. A goal is a representation of the intended goal of the snippet.</p>
<p>For every domain, an ontology of possible goals has to be defined. For instance, a snippet might have the goal of “having a tower”.</p>
<p>Notice that unlike classical planning approaches, postconditions cannot be specified for snippets, since a snippet is not guaranteed to succeed. Thus, we can only specify the goal a snippet pursues, i.e., its success conditions.</p>
<p><strong>The Difference between a postcondition and a success condition :</strong></p>
<p>A postcondition is a condition that we can ensure is going to be true after the execution of a snippet (or an action), while a success condition is a condition that when satisfied we can consider the snippet (or action) to have completed.</p>
<p>For example, a side effect of an action is a postcondition but not a success condition: “enemy killed” is a success condition of an attack, but not a postcondition since we cannot ensure that after the attack is done the enemy would be killed( because the domain is non-deterministic).  Our use of success conditions instead of postconditions defines an abstraction over the notion of a nondeterministic action in planning handled by interleaving planning and execution.</p>
<p><strong>Specifically, three things need to be defined for using Darmok in a particular domain:</strong></p>
<p>• A set of basic actions that can be used in the domain. For instance, in Wargus we define actions such as move, attack, or build. For uniformity, in Darmok actions are treated as standard snippets, and thus have a goal, preconditions and alive conditions (so that the system can reason about them too).</p>
<p>• A set of sensors, that are used to obtain information about the current state of the world, and are used to specify the preconditions, alive conditions and goals of snippets. For instance, in Wargus we might define sensors such as numberOfTroops, or unitExists. A sensor might return any of the standard basic data types, such as boolean or integer.</p>
<p>• A set of goals. Goals can be structured in a specialization hierarchy in order to specify the relations among them.</p>
<p>A goal might have parameters, and for each goal a set of success conditions is defined. For instance, HaveUnits(TOWER) is a valid goal in our gaming domain and it has as success condition: UnitExists(TOWER). Therefore, the goal definition can be used by the system to reason about the intended result of a snippet, while the success conditions are used by the execution engine to verify whether a particular snippet succeeds at run time.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ferasferas.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ferasferas.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ferasferas.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ferasferas.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ferasferas.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ferasferas.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ferasferas.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ferasferas.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ferasferas.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ferasferas.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ferasferas.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ferasferas.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ferasferas.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ferasferas.wordpress.com/285/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ferasferas.wordpress.com&amp;blog=7413391&amp;post=285&amp;subd=ferasferas&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ferasferas.wordpress.com/2010/10/29/ocbp-introducing-darmok/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fe322488701d50730f07f91b9689a718?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ferasferas</media:title>
		</media:content>

		<media:content url="http://ferasferas.files.wordpress.com/2010/10/ocbp-3.png" medium="image">
			<media:title type="html">OCBP-3</media:title>
		</media:content>
	</item>
		<item>
		<title>On-line Case-Based Planning</title>
		<link>http://ferasferas.wordpress.com/2010/10/28/on-line-case-based-planning/</link>
		<comments>http://ferasferas.wordpress.com/2010/10/28/on-line-case-based-planning/#comments</comments>
		<pubDate>Thu, 28 Oct 2010 04:10:29 +0000</pubDate>
		<dc:creator>ferasferas</dc:creator>
				<category><![CDATA[AI]]></category>

		<guid isPermaLink="false">http://ferasferas.wordpress.com/?p=275</guid>
		<description><![CDATA[This Paper is Made By (i will only try to summarize it for a general Reader): Santi Ontanon and Kinshuk Mishra and Neha Sugandh and Ashwin Ram CCL, Cognitive Computing Lab, Georgia Institute of Technology, Atlanta, GA 30322/0280, USA &#160; Abstract Some domains, such as real-time strategy (RTS) games, pose several challenges to traditional planning [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ferasferas.wordpress.com&amp;blog=7413391&amp;post=275&amp;subd=ferasferas&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>This Paper is Made By (i will only try to summarize it for a general Reader): </strong></p>
<p style="text-align:center;">Santi Ontanon and Kinshuk Mishra and Neha Sugandh and Ashwin Ram<br />
CCL, Cognitive Computing Lab,<br />
Georgia Institute of Technology,<br />
Atlanta, GA 30322/0280, USA</p>
<p style="text-align:left;">&nbsp;</p>
<p style="text-align:center;"><strong>Abstract</strong><br />
Some domains, such as real-time strategy (RTS) games, pose several challenges to traditional planning and machine learning techniques. In this paper,  a novel on-line case-based planning architecture that addresses some of these problems. The architecture addresses issues of plan acquisition, on-line plan execution, interleaved planning and execution and on-line plan adaptation. It also introduces <strong>the Darmok system</strong>, which implements this architecture in order to play Wargus (an open source clone of the well-known RTS game Warcraft II). Then presents empirical evaluation of the performance of <strong>Darmok</strong> and show that it successfully learns to play the Wargus game.</p>
<p style="text-align:left;">&nbsp;</p>
<p><!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } --><a href="http://ferasferas.files.wordpress.com/2010/10/screenshot-11.png"><img class="aligncenter size-full wp-image-278" title="Screenshot-1" src="http://ferasferas.files.wordpress.com/2010/10/screenshot-11.png?w=550&#038;h=293" alt="" width="550" height="293" /></a></p>
<p>There are four  refinements with respect to the original CBR  cycle:</p>
<p>1. Problems “enter the cycle” through the Expansion  process. When a new problems arrives to the system, this problem  is set as the current plan, i.e. the current plan consists of a  single open problem. Thus, the first thing the Expansion module  will do is to send this problem to the retrieve process.</p>
<p>2.  The CBR cycle is divided in two parts: a first part composed of  retrieval and adaptation (or reuse), and a second part composed  of revision and retention. The first part is in charge of finding  solutions to new problems (i.e. it corresponds to the problem  solving capability of the CBR cycle), and the second part is  responsible for learning from experience. Revision takes as input  the outcome of executing the solutions provided by the system  and revises them to verify they achieve their goals. Revised solutions are handed to retention, that will decide whether to retain new  cases or not, and update any internal indexes or similarity  metrics when required.</p>
<p>3. The new cycle incorporates the world in  it’s design, since it is an important part of any real-time  problem solving process.</p>
<p>4. The new cycle features a new delayed  adaptation cycle (notice that there is a loop between adaptation  and expansion). In a domain where the domain changes dynamically,  we want to delay adaptation till the last moment to ensure that  plans are adapted with the latest information. Thus, the  expansion component may send back plans to adaptation if the environment  changed too much since the last time the plan was adapted. Moreover,  notice that for real-time domains it is important for adaptation echniques  to be efficient.</p>
<p><strong>Expansion:</strong></p>
<p>1- Takes the current solution proposed by the system for a problem (i.e. the current plan), and tries to find open sub-problems (sub-goals) in it. If there are any, these sub-problems are sent to the retrieve process so that they can be solved.</p>
<p>2- Also monitor the world state for changes, and send plans to the adaptation module again in case the world state changes enough so that plans have to be changed. We call this a delayed adaptation, since adaptation is delayed and performed at run-time with the latest game state.</p>
<p><strong>Execution:</strong></p>
<p>This process is in charge of executing the current plan and updating its status according to the result of execution. If a particular step in the plan fails when executed, and that causes a particular sub- problem to fail, then the execution process will update the current plan to reflect this. When that happens the expansion module will be responsible to find an alternative plan for such a sub-problem.</p>
<p><a href="http://ferasferas.files.wordpress.com/2010/10/ocbp_screenshot-2.png"><img class="aligncenter size-full wp-image-279" title="OCBP_Screenshot-2" src="http://ferasferas.files.wordpress.com/2010/10/ocbp_screenshot-2.png?w=550&#038;h=225" alt="" width="550" height="225" /></a></p>
<p>Why Planing in RTS(Real Time Strategy) are Hard ?</p>
<p><!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } -->Real-time strategy (RTS) games have several characteristics that make the application of traditional planning approaches difficult:</p>
<p>• They have huge decision space (i.e. the set of different actions that can be executed in any given state is huge).</p>
<p>• Huge state space (the combination of the previous bullet and this bullet makes them not suitable for search based AI techniques (<a href="http://en.wikipedia.org/wiki/Minimax"> Minimax</a>, <a href="http://en.wikipedia.org/wiki/Alpha-beta_pruning"><em> Alpha</em>-beta  pruning ) </a></p>
<p>• They are non-deterministic.</p>
<p>• They are incomplete information games, where the player can only sense the part of the map he has explored and include unpredictable opponents.</p>
<p>• They are real-time. Thus, while the system is deciding which actions to execute, the game continues executing and the game state changes constantly. They are difficult to represent using classical planning formalisms since postconditions for actions cannot be specified easily.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ferasferas.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ferasferas.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ferasferas.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ferasferas.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ferasferas.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ferasferas.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ferasferas.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ferasferas.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ferasferas.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ferasferas.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ferasferas.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ferasferas.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ferasferas.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ferasferas.wordpress.com/275/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ferasferas.wordpress.com&amp;blog=7413391&amp;post=275&amp;subd=ferasferas&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ferasferas.wordpress.com/2010/10/28/on-line-case-based-planning/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fe322488701d50730f07f91b9689a718?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ferasferas</media:title>
		</media:content>

		<media:content url="http://ferasferas.files.wordpress.com/2010/10/screenshot-11.png" medium="image">
			<media:title type="html">Screenshot-1</media:title>
		</media:content>

		<media:content url="http://ferasferas.files.wordpress.com/2010/10/ocbp_screenshot-2.png" medium="image">
			<media:title type="html">OCBP_Screenshot-2</media:title>
		</media:content>
	</item>
		<item>
		<title>Structure of CBP part4- “Plan Anticipator and Final Model”</title>
		<link>http://ferasferas.wordpress.com/2010/10/27/structure-of-cbp-part4-%e2%80%9cplan-anticipator-and-final-model%e2%80%9d/</link>
		<comments>http://ferasferas.wordpress.com/2010/10/27/structure-of-cbp-part4-%e2%80%9cplan-anticipator-and-final-model%e2%80%9d/#comments</comments>
		<pubDate>Wed, 27 Oct 2010 11:17:01 +0000</pubDate>
		<dc:creator>ferasferas</dc:creator>
				<category><![CDATA[AI]]></category>

		<guid isPermaLink="false">http://ferasferas.wordpress.com/?p=270</guid>
		<description><![CDATA[Problem anticipation This is so the prediction of a problem can be used to find the plans in memory that avoid it. The whole point of an ANTICIPATOR is to provide information about problems that have to be avoided, information that will be used by a RETRIEVER to find a plan that does so, so [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ferasferas.wordpress.com&amp;blog=7413391&amp;post=270&amp;subd=ferasferas&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } --><span style="font-family:Liberation Serif,serif;"><span style="font-size:small;"><strong>Problem anticipation</strong></span></span></p>
<p><span style="font-family:Liberation Serif,serif;"><span style="font-size:small;">This is so the prediction of a problem can be used to find the plans in memory that avoid it. The whole point of an <strong>ANTICIPATOR</strong> is to provide information about problems that have to be avoided, information that will be used by a <strong>RETRIEVER</strong> to find a plan that does so, so it makes sense that an <strong>ANTICIPATOR</strong> has to be called prior to any search for plans . To anticipate a problem on the basis of surface features, the <strong>ANTICIPATOR</strong> needs the base of information built by the <strong>ASSIGNER</strong>. </span></span></p>
<p><span style="font-family:Liberation Serif,serif;"><span style="font-size:small;">Let us again consider the example of the traveler. The task of the <strong>ANTICIPATOR</strong> is to take the features of the situation that the planner is dealing with, and recall the problems that have arisen in past situations to handle them. By being reminded of the problems caused by waiting for luggage, a planner can either find a past plan that deals with the problem, or alter another plan in response to the prediction. The problem can be avoided because it can be predicted. </span></span></p>
<p><span style="font-family:Liberation Serif,serif;"><span style="font-size:small;">There is an important relationship between plans stored in memory and the tasks of the <strong>ANTICIPATOR</strong> and the <strong>RETRIEVER</strong>. Once a problem plan has been repaired, it is stored in memory, indexed by the fact that it deals with a particular problem. At this point, however, there is no way for the planner to look at a new situation and predict that it will have to avoid that problem. </span></span></p>
<p><span style="font-family:Liberation Serif,serif;"><span style="font-size:small;">So there is no way for it to find the plan in situations where the problem will come up again. Because of this, it will continue to make the same mistake because it does not know that the planning approach it used before in a similar situation led to problems. If it can figure out the causes of a failure, however, it can use this information to anticipate the problem in similar situations and look for a plan that avoids it. The <strong>ASSIGNER</strong> figures out the causes of problem. </span></span></p>
<p><span style="font-family:Liberation Serif,serif;"><span style="font-size:small;">The <strong>ANTICIPATOR</strong> then uses the information built up by the <strong>ASSIGNER</strong> to predict the problem again when similar causes are present. The <strong>ANTICIPATOR</strong> notices that a problem is going to arise and then tells the <strong>RETRIEVER</strong> to find a plan that avoids it.</span></span></p>
<p><span style="font-family:Liberation Serif,serif;"><span style="font-size:small;"> <strong>The final package </strong></span></span></p>
<p><span style="font-family:Liberation Serif,serif;"><span style="font-size:small;">The basic case-based planner that grows out of the need to reuse plans and adapt them for new goals functions as follows: A set of goals is handed to the planner and sent directly to the <strong>ANTICIPATOR</strong>. </span></span></p>
<p><span style="font-family:Liberation Serif,serif;"><span style="font-size:small;">The <strong>ANTICIPATOR</strong>, based on the knowledge built up by the <strong>ASSIGNER</strong>, makes any predictions of planning problems that it thinks will arise out of the current goals. The goals are then handed to the <strong>RETRIEVER</strong> along with the <strong>ANTICIPATOR&#8217;s</strong> predictions of problems that have to be avoided. The <strong>RETRIEVER</strong> uses both to search for a plan in memory that best satisfies the goals it is trying to achieve and that avoids any problems that have been anticipated. The result is a past plan that matches some or all of the goals now being planned for. </span></span></p>
<p><span style="font-family:Liberation Serif,serif;"><span style="font-size:small;">This plan is sent to the <strong>MODIFIER</strong>, which adds or substitutes new steps to the plan in order to make it satisfy any of the planner&#8217;s goals that it does not yet achieve. Once modified, the plan is run and the results checked against the goals of the planner. If there is a failure, either because a desired goal has not been achieved or because an undesired state has resulted from the plan, the plan is given to the <strong>REPAIRER</strong>. </span></span></p>
<p><span style="font-family:Liberation Serif,serif;"><span style="font-size:small;">The <strong>REPAIRER</strong> builds a characterization of the failure and uses this to find and apply one of its repair methods. The repaired plan, along with a description of the problems that had to be solved along the way, are then sent to the <strong>STORER</strong> for placement into memory. The <strong>STORER</strong> indexes the new plan by the goals it achieves and the problems it avoids. Now the plan can be used again in similar circumstances in the future. </span></span></p>
<p><span style="font-family:Liberation Serif,serif;"><span style="font-size:small;">While the <strong>REPAIRER</strong> is repairing the plan, the <strong>ASSIGNER</strong> is deciding which features in the original request, that is, which goals, interacted to cause the failure to occur. Once it has done this, it marks these features as predictive of the problem so that the <strong>ANTICIPATOR</strong> can anticipate the problem if it encounters the goals in a later input. </span></span></p>
<p><span style="font-family:Liberation Serif,serif;"><span style="font-size:small;">This planner does two things as it builds a plan: it tries to satisfy a set of goals using its model of what plans are appropriate for different situations and at the same time it is also tests that model of the appropriateness of those plans against the real world, so that later planning will be easier and more reliable. </span></span></p>
<p><span style="font-family:Liberation Serif,serif;"><span style="font-size:small;">To serve its first function, the planner has to react to failures by repairing the present plan. To serve its second function, it has to alter its view of the world by adding new plans indexed by the problems they solve and by altering its predictions so that it can anticipate those problems and find the plans that avoid them.</span></span></p>
<p>&nbsp;</p>
<p><strong>Reference</strong> :</p>
<p>Case-Based Planning – A Framework for planning from experience – 1994</p>
<p><span style="font-family:Liberation Serif,serif;"><span style="font-size:small;"><br />
</span></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ferasferas.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ferasferas.wordpress.com/270/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ferasferas.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ferasferas.wordpress.com/270/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ferasferas.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ferasferas.wordpress.com/270/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ferasferas.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ferasferas.wordpress.com/270/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ferasferas.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ferasferas.wordpress.com/270/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ferasferas.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ferasferas.wordpress.com/270/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ferasferas.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ferasferas.wordpress.com/270/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ferasferas.wordpress.com&amp;blog=7413391&amp;post=270&amp;subd=ferasferas&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ferasferas.wordpress.com/2010/10/27/structure-of-cbp-part4-%e2%80%9cplan-anticipator-and-final-model%e2%80%9d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fe322488701d50730f07f91b9689a718?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ferasferas</media:title>
		</media:content>
	</item>
	</channel>
</rss>
