--- In aima-talk@yahoogroups.com, "matsudayuko69" <matsuda.yuko@...> wrote:
>
> Simple question: How about Mathemaitca for this purpose?
>
> I've been using Lisp, C, Java and now using Mathematica.
>
I'd be happy to contribute in developing Mathematica code for AIMA.
Regards,
Juan Flores
Hi!
I found several issues with the code in csp.py, version
aima-python.2007.06.15.zip:
1) Forward Checking and Maintain Arc Consistency don't work because of a thinko
in csp.unassign:
def unassign(self, var, assignment):
"""Remove {var: val} from assignment; that is backtrack. (...) """
if var in assignment:
# Reset the curr_domain to be the full original domain
if self.curr_domains:
--> self.curr_domains[var] = self.domains[var][:]
del assignment[var]
That cannot work because it discards too much information. The assignments made
in previous recursions can all potentially lead to prunings of the current
node's domain. In the highlighted line, instead of carefully undoing of the
effects a particular assignment, the domain is reset to its initial value,
thereby throwing away knowledge of those earlier prunings.
Both backtrackging_search(usa, fc=True) and backtracking_search(usa, mac=True)
return incorrectly colored maps.
2) The Most Constrained Variable heuristic has it backwards and prefers less
constrained variables over more constrained variables. That's why
backtracking_search(usa, mcv=True) is guaranteed to run for many hours,
exploring the search tree in the most inefficient possible way.
3) The Least Constraining Value heuristic fails to compile on modern python.
I took the liberty of developing and testing a patch for the aforementioned
issues. Furthermore, it contains a formulation of the Sudoku problem using the
csp.py machinery.
Please find it at:
http://code.google.com/p/aima-python/issues/detail?id=11
regards,
Edgar Holleis
I've been looking through the python code for the search algorithms. I must acknowledge that I am pretty new to python, so apologies for basic mistakes. Having dragged the various needed classes and subclasses etc. from the original setup, I'm left with:
#!/usr/bin/python
from __future__ import generators
import math
import random import sys import time import bisect import string import sets
infinity = 1.0e400
class Problem: """The abstract class for a formal problem. You should subclass this and
implement the method successor, and possibly __init__, goal_test, and path_cost. Then you will create instances of your subclass and solve them with the various search functions."""
def __init__(self, initial, goal=None): """The constructor specifies the initial state, and possibly a goal state, if there is a unique goal. Your subclass's constructor can add
other arguments.""" self.initial = initial; self.goal = goal
def successor(self, state): """Given a state, return a sequence of (action, state) pairs reachable
from this state. If there are many successors, consider an iterator that yields the successors one at a time, rather than building them all at once. Iterators will work fine within the framework."""
abstract
def goal_test(self, state): """Return True if the state is a goal. The default method compares the state to self.goal, as specified in the constructor. Implement this
method if checking against a single self.goal is not enough.""" return state == self.goal
def path_cost(self, c, state1, action, state2): """Return the cost of a solution path that arrives at state2 from
state1 via action, assuming cost c to get up to state1. If the problem is such that the path doesn't matter, this function will only look at state2. If the path does matter, it will consider c and maybe state1
and action. The default method costs 1 for every step in the path.""" return c + 1
def value(self): """For optimization problems, each state has a value. Hill-climbing
and related algorithms try to maximize this value.""" abstract
class Node: """A node in a search tree. Contains a pointer to the parent (the node that this is a successor of) and to the actual state for this node. Note
that if a state is arrived at by two paths, then there are two nodes with the same state. Also includes the action that got us to this state, and the total path_cost (also known as g) to reach the node. Other functions
may add an f and h value; see best_first_graph_search and astar_search for an explanation of how the f and h values are handled. You will not need to subclass this class."""
def __init__(self, state, parent=None, action=None, path_cost=0):
"Create a search tree Node, derived from a parent by an action." update(self, state=state, parent=parent, action=action, path_cost=path_cost, depth=0) if parent:
self.depth = parent.depth + 1
def path(self): "Create a list of nodes from the root to this node."
x, result = self, [self] while x.parent: result.append(x.parent) x = x.parent return result
def expand(self, problem): "Return a list of nodes reachable from this node. [Fig. 3.8]"
return [Node(next, self, act, problem.path_cost(self.path_cost, self.state, act, next)) for (act, next) in problem.successor(self.state)]
class Graph: """A graph connects nodes (verticies) by edges (links). Each edge can also
have a length associated with it. The constructor call is something like: g = Graph({'A': {'B': 1, 'C': 2}) this makes a graph with 3 nodes, A, B, and C, with an edge of length 1 from
A to B, and an edge of length 2 from A to C. You can also do: g = Graph({'A': {'B': 1, 'C': 2}, directed=False) This makes an undirected graph, so inverse links are also added. The graph
stays undirected; if you add more links with g.connect('B', 'C', 3), then inverse link is also added. You can use g.nodes() to get a list of nodes, g.get('A') to get a dict of links out of A, and g.get('A', 'B') to get the
length of the link from A to B. 'Lengths' can actually be any object at all, and nodes can be any hashable object."""
def __init__(self, dict=None, directed=True): self.dict = dict or {}
self.directed = directed if not directed: self.make_undirected()
def make_undirected(self): "Make a digraph into an undirected graph by adding symmetric edges." for a in self.dict.keys():
for (b, distance) in self.dict[a].items(): self.connect1(b, a, distance)
def connect(self, A, B, distance=1): """Add a link from A and B of given distance, and also add the inverse
link if the graph is undirected.""" self.connect1(A, B, distance) if not self.directed: self.connect1(B, A, distance)
def connect1(self, A, B, distance): "Add a link from A to B of given distance, in one direction only."
self.dict.setdefault(A,{})[B] = distance
def get(self, a, b=None): """Return a link distance or a dict of {node: distance} entries. .get(a,b) returns the distance or None;
.get(a) returns a dict of {node: distance} entries, possibly {}.""" links = self.dict.setdefault(a, {}) if b is None: return links else: return links.get(b)
def nodes(self):
"Return a list of nodes in the graph." return self.dict.keys()
class GraphProblem(Problem): "The problem of searching a graph from one node to another." def __init__(self, initial, goal, graph):
Problem.__init__(self, initial, goal) self.graph = graph
def successor(self, A): "Return a list of (action, result) pairs." return [(B, B) for B in self.graph.get(A).keys()]
def path_cost(self, cost_so_far, A, action, B): return cost_so_far + (self.graph.get(A,B) or infinity)
def h(self, node): "h function is straight-line distance from a node's state to goal."
locs = getattr(self.graph, 'locations', None) if locs: return int(distance(locs[node.state], locs[self.goal])) else: return infinity
class Queue:
"""Queue is an abstract class/interface. There are three types: Stack(): A Last In First Out Queue. FIFOQueue(): A First In First Out Queue. PriorityQueue(lt): Queue where items are sorted by lt, (default <).
Each type supports the following methods and functions: q.append(item) -- add an item to the queue q.extend(items) -- equivalent to: for item in items: q.append(item) q.pop() -- return the top item from the queue
len(q) -- number of items in q (also q.__len()) Note that isinstance(Stack(), Queue) is false, because we implement stacks as lists. If Python ever gets interfaces, Queue will be an interface."""
def __init__(self): abstract
def extend(self, items): for item in items: self.append(item)
class PriorityQueue(Queue): """A queue in which the minimum (or maximum) element (as determined by f and
order) is returned first. If order is min, the item with minimum f(x) is returned first; if order is max, then it is the item with maximum f(x).""" def __init__(self, order=min, f=lambda x: x):
update(self, A=[], order=order, f=f) def append(self, item): bisect.insort(self.A, (self.f(item), item)) def __len__(self): return len(self.A) def pop(self): if self.order == min:
return self.A.pop(0)[1] else: return self.A.pop()[1]
def update(x, **entries): """Update a dict; or an object with slots; according to entries. >>> update({'a': 1}, a=10, b=20)
{'a': 10, 'b': 20} >>> update(Struct(a=1), a=10, b=20) Struct(a=10, b=20) """ if isinstance(x, dict): x.update(entries) else: x.__dict__.update(entries)
return x
def memoize(fn, slot=None): """Memoize fn: make it remember the computed value for any argument list. If slot is specified, store result in that slot of first argument.
If slot is false, store results in a dictionary.""" if slot: def memoized_fn(obj, *args): if hasattr(obj, slot): return getattr(obj, slot) else:
val = fn(obj, *args) setattr(obj, slot, val) return val else: def memoized_fn(*args): if not memoized_fn.cache.has_key(
def graph_search(problem, fringe): """Search through the successors of a problem to find a goal.
The argument fringe should be an empty queue. If two paths reach a state, only use the best one. [Fig. 3.18]""" closed = {} fringe.append(Node(problem.initial)) while fringe:
node = fringe.pop() if problem.goal_test(node.state): print Node.path return node if node.state not in closed: closed[node.state] = True fringe.extend(node.expand(problem))
print fringe.len() return None
def best_first_graph_search(problem, f): """Search the nodes with the lowest f scores first. You specify the function f(node) that you want to minimize; for example,
if f is a heuristic estimate to the goal, then we have greedy best first search; if f is node.depth then we have depth-first search. There is a subtlety: the line "f = memoize(f, 'f')" means that the f
values will be cached on the nodes as they are computed. So after doing a best first search you can examine the f values of the path returned.""" f = memoize(f, 'f') return graph_search(problem, PriorityQueue(min, f))
def astar_search(problem, h=None): """A* search is best-first graph search with f(n) = g(n)+h(n). You need to specify the h function when you call astar_search. Uses the pathmax trick: f(n) = max(f(n), g(n)+h(n))."""
h = h or problem.h def f(n): return max(getattr(n, 'f', -infinity), n.path_cost + h(n)) return best_first_graph_search(problem, f)
Which appears to work, and exits without any errors. However - 1/ does this solve the path? 2/ How can I get it to output the final path? I've tried with print statements within the code, and have tried adding an 'overall path' variable list, but can't seem to get it functional.
Any help would be much appreciated sorry if I've missed the obvious etc - still pretty new to this lark!
Good think this came up - I had already started :/
That'll teach me to `assume' that I'm eligible =)
Nima
On Wed, Apr 29, 2009 at 3:59 AM, Peter Norvig <peter@...> wrote:
If it were up to me, I would have it open to anyone, regardless of residency, and regardless of status as a student or teacher. But Prentice Hall has legal issues they have to work with, and that's what they decided would be easiest.
-Peter
--- In aima-talk@yahoogroups.com, Bilal Hayat Butt <bilal_hayat_butt@...> wrote:
>
> Whats the point in having it for US residents only?
> ---------------
> 2. Eligibility.
>
> Open to legal U.S. residents, that are instructors or students (enrolled at a two- or four-year college).
>
> [3 ! |_ /
If it were up to me, I would have it open to anyone, regardless of residency,
and regardless of status as a student or teacher. But Prentice Hall has legal
issues they have to work with, and that's what they decided would be easiest.
-Peter
--- In aima-talk@yahoogroups.com, Bilal Hayat Butt <bilal_hayat_butt@...> wrote:
>
> Whats the point in having it for US residents only?
> ---------------
> 2. Eligibility.
>
> Open to legal U.S. residents, that are instructors or students (enrolled at a
two- or four-year college).
>
> [3 ! |_ /
Light-hearted suggestion:
Instead of God's finger touching Adam, ala Michelangelo, we could have a
human in the clouds touching the finger of a robot agent.
- Bob Futrelle
On 12:51:03 am 04/22/09 "Peter Norvig" <peter@...> wrote:
>
>
>
> We're having a contest to design the cover for the 3rd
> edition.
> Open to instructors and students, see the contest rules at
> http://media.pearsoncmg.com/ph/esm/ecs_ai/ . Deadline June 15th.
> -Peter Norvig
>
>
>
>
That's great. Is there any information available on what to expect in
the 3rd edition or an estimate of when to expect it to be available
for purchase?
Thanks
Donnchadh
2009/4/22 Peter Norvig <peter@...>:
>
>
> We're having a contest to design the cover for the 3rd edition.
>
> Open to instructors and students, see the contest rules at
> http://media.pearsoncmg.com/ph/esm/ecs_ai/ . Deadline June 15th.
>
> -Peter Norvig
>
We're having a contest to design the cover for the 3rd edition.
Open to instructors and students, see the contest rules at
http://media.pearsoncmg.com/ph/esm/ecs_ai/ . Deadline June 15th.
-Peter Norvig
You're right; Fig 3.1 is not well-integrated with the text -- but we will have better integration in the 3rd edition of AIMA.
As for how it works: the idea is that if the agent has a plan (in the variable seq), it executes the plan, one step each time it is called. If it does not have a plan, it forumlates a goal, then a problem, then searches for a plan that solves the problem, then begins executing it.
-Peter
On Wed, Jan 21, 2009 at 4:32 AM, Bob Futrelle <bob.futrelle@...> wrote:
The formulation in Fig 3.1 is not mentioned again, so its application
to the clear examples in Sec 3.2 is obscure at best.
How *does* it apply? Esp. since it only returns a single action.
-- Bob Futrelle
Newton Mass &
Northeastern University
Sent from my iPhone
The formulation in Fig 3.1 is not mentioned again, so its application
to the clear examples in Sec 3.2 is obscure at best.
How *does* it apply? Esp. since it only returns a single action.
-- Bob Futrelle
Newton Mass &
Northeastern University
Sent from my iPhone
I've started writing a framework, however it's not necessarily because there doesn't exist a framework which I can use (maybe one exists that is good, and maybe there isn't)... My main reason is to get a deeper understanding; As Confucious said...
I hear and I forget. I see and I remember. I do and I understand.
Anyway, I'm using Objective-C and C, and the Cocoa framework. I'd like to learn how to integrate python and ObjC (I think it is possible, but have failed to get it working)... I think that would be awesome for me - as I can write proof-of-concepts in python, then convert parts to C/ObjC as I see fit.
So far I've implemented a Multi-layer (non-recurrent) NN with back-prop in python, SOM with various 1D, 2D and 3D lattices and an OpenGL view of the machine learning, and similarly a Perceptron.
I'm not sure how many people here would be interested in writing Mac software though =)
Nima
On Sat, Dec 6, 2008 at 8:45 PM, Mani Sabri <mani_sabri@...> wrote:
No doubt that python makes a good implementation language. and it will
be fast enough if we use Pyrex or Cython along with c/c++ extensions.
I wrote some code for multi-Agent realtime environments and later I
found out that there is a project named SPADE (Smart Python
multi-Agent Development Environment) which use XMPP/Jabber and
implements FIPA standards but the problem with SPADE is that there is
no community around them (no forum no mailing list just the emails of
the owners).
so I don't know where to start, I want to learn and to have a serious
framework at the end of my study, may be its not the right direction
(is it?) but if it is I will be glad to contribute to this project or
make a fork of it and ...
Best Regards
Mani
--- In aima-talk@yahoogroups.com, "Ravi Mohan" <magesmail@...> wrote:
>
> Hi,
>
> I wouldn't want to speak for the maintainers of the python
> repository, but as the maintainer of the java code repository I think
> it is important to understand how open source works.
>
> The amount of progress is directly dependent on how much free time and
> energy the maintainers have and often this has peaks and lulls. I
> wrote most of the java code for AIMA, but I have been insanely busy
> over the last year. Dr Ciaran O'Reilly has been adding a *lot* of
> code, however, mostly in the logic section, but also filling in some
> of the gaps in search.(see the svn branch dedicated to this effort.
> This will be merged into a new release soon).
>
> Next year, (2009) I'll have more free time and I plan to add graphics
> to the existing codebase. Particularly for small projects with
> contributors in the single digits, this ebb and flow is just how it
works.
>
> If you believe that Python makes a good implementation language (I
> think it does - the size of the python implementation of an algorithm
> is a fraction of the size of the equivalent java code), please
> contribute some code. That way, everyone wins.
>
> My 2 cents,
>
> Ravi
>
>
> --- In aima-talk@yahoogroups.com, "Mani Sabri" <mani_sabri@> wrote:
> >
> > hi
> > I was looking at AIMA python code repository in google and asking
> > myself is python still considered viable in this community. the java
> > repository seems to have all the recent focus and development. why?
> > personal preferences of project owners or some other reasons?
> >
> >
> > Best Regards
> > Mani
> >
>
Hi,
I wouldn't want to speak for the maintainers of the python
repository, but as the maintainer of the java code repository I think
it is important to understand how open source works.
The amount of progress is directly dependent on how much free time and
energy the maintainers have and often this has peaks and lulls. I
wrote most of the java code for AIMA, but I have been insanely busy
over the last year. Dr Ciaran O'Reilly has been adding a *lot* of
code, however, mostly in the logic section, but also filling in some
of the gaps in search.(see the svn branch dedicated to this effort.
This will be merged into a new release soon).
Next year, (2009) I'll have more free time and I plan to add graphics
to the existing codebase. Particularly for small projects with
contributors in the single digits, this ebb and flow is just how it works.
If you believe that Python makes a good implementation language (I
think it does - the size of the python implementation of an algorithm
is a fraction of the size of the equivalent java code), please
contribute some code. That way, everyone wins.
My 2 cents,
Ravi
--- In aima-talk@yahoogroups.com, "Mani Sabri" <mani_sabri@...> wrote:
>
> hi
> I was looking at AIMA python code repository in google and asking
> myself is python still considered viable in this community. the java
> repository seems to have all the recent focus and development. why?
> personal preferences of project owners or some other reasons?
>
>
> Best Regards
> Mani
>
hi
I was looking at AIMA python code repository in google and asking
myself is python still considered viable in this community. the java
repository seems to have all the recent focus and development. why?
personal preferences of project owners or some other reasons?
Best Regards
Mani
--- In aima-talk@yahoogroups.com, "sprgr77" <sprgr77@...> wrote:
>
> Iam interested in AI .I need guidelines to solve the exercises in the
> book"Artificial intelligence A modern approach".
>
...and your question would be... ?
The attachment was stripped as suspected, so here's the readable version...
http://ai.autonomy.net.au/chrome/site/AIMA-18.4.png
Nima
--- In aima-talk@yahoogroups.com, "Nima Talebi" <nima.talebi@...> wrote:
>
> Okay, I can already see a flaw in this, here's my revised version...
>
> I've attached my formula as a png, hope it gets through, in case it
> doesn't...
>
> *Text:*
> E=|_sum_{{i=0};{i=M-m};{|_pmatrix1x2_{{M};{m+i}}ε^{m+i}}}
>
> *LaTeX:
> *\mbox{E}=\sum_{i=0}^{i=M-m}{\left(\begin{array}{c} M \\ m+i
> \end{array}\right)\epsilon ^{m+i}}
>
> ...where m is the *bigger half* - that is the `half' that has just enough
> power to out-weight the other half, for example where M = 20, m = 11, where
> M = 5, m = 3.
>
> Again, I don't think I have the right, or at least most elegant solution to
> the problem, I feel it has to be much simpler - otherwise the question
> wouldn't seriously expect us to calculate the above formula for M = 20 as
> that sum would expand into 9 terms!
>
> Nima
>
>
> On Fri, Oct 24, 2008 at 12:37 AM, Nima Talebi <nima.talebi@...> wrote:
>
> > Hi,
> >
> > I'm interested to see if my solution is even remotely correct, the question
> > is to derive the error formula given the number of experts/hypotheses (M)
> > and also the error of each hypotheses (e) - assuming all to be the same, and
> > that all are independent of one another...
> >
> > I treated this as a probability problem (and unsure if I should have done
> > so), and hence derived a formula which yields the following results...
> >
> > M:5, e:0.10, 0.0100
> > M:5, e:0.20, 0.0800
> > M:5, e:0.40, 0.6400
> > M:10, e:0.10, 0.0002
> > M:10, e:0.20, 0.0134
> > M:10, e:0.40, 0.8602
> > M:20, e:0.10, 0.0000
> > M:20, e:0.20, 0.0034
> > M:20, e:0.40, 7.0448
> >
> > The third column is the total error for the network I calculated; it
> > certainly looks wrong from looking at the last value, but I'd like to know
> > how to go about solving this as it's rather intriguing.
> >
> > My `formula' in Python form is as follows...
> >
> > def fact(k):
> > return reduce(lambda i, j : i*j, range(1, k+1))
> >
> > for M in 5, 10, 20:
> > for e in 0.1, 0.2, 0.4:
> > m = M/2+1
> > _m = M-m
> >
> > print "M:%d, e:%0.2f, %0.4f"%(M, e, (fact(M) * pow(e, m))/(fact(_m) *
> > fact(m)))
> >
> > Thanks to anyone who has a crack at solving this =)
> >
> > Nima
> >
> >
>
>
> --
> Nima Talebiw: http://ai.autonomy.net.au/
> p: +61-4-0667-7607 m: nima@...
>
I'm interested to see if my solution is even remotely correct, the question is to derive the error formula given the number of experts/hypotheses (M) and also the error of each hypotheses (e) - assuming all to be the same, and that all are independent of one another...
I treated this as a probability problem (and unsure if I should have done so), and hence derived a formula which yields the following results...
The third column is the total error for the network I calculated; it certainly looks wrong from looking at the last value, but I'd like to know how to go about solving this as it's rather intriguing.
My `formula' in Python form is as follows...
def fact(k): return reduce(lambda i, j : i*j, range(1, k+1))
for M in 5, 10, 20: for e in 0.1, 0.2, 0.4: m = M/2+1 _m = M-m
print "M:%d, e:%0.2f, %0.4f"%(M, e, (fact(M) * pow(e, m))/(fact(_m) * fact(m))) Thanks to anyone who has a crack at solving this =)
LaTeX: \mbox{E}=\sum_{i=0}^{i=M-m}{\left(\begin{array}{c} M \\ m+i \end{array}\right)\epsilon ^{m+i}}
...where m is the bigger half - that is the `half' that has just enough power to out-weight the other half, for example where M = 20, m = 11, where M = 5, m = 3.
Again, I don't think I have the right, or at least most elegant solution to the problem, I feel it has to be much simpler - otherwise the question wouldn't seriously expect us to calculate the above formula for M = 20 as that sum would expand into 9 terms!
Nima
On Fri, Oct 24, 2008 at 12:37 AM, Nima Talebi <nima.talebi@...> wrote:
Hi,
I'm interested to see if my solution is even remotely correct, the question is to derive the error formula given the number of experts/hypotheses (M) and also the error of each hypotheses (e) - assuming all to be the same, and that all are independent of one another...
I treated this as a probability problem (and unsure if I should have done so), and hence derived a formula which yields the following results...
The third column is the total error for the network I calculated; it certainly looks wrong from looking at the last value, but I'd like to know how to go about solving this as it's rather intriguing.
My `formula' in Python form is as follows...
def fact(k): return reduce(lambda i, j : i*j, range(1, k+1))
for M in 5, 10, 20: for e in 0.1, 0.2, 0.4: m = M/2+1 _m = M-m
print "M:%d, e:%0.2f, %0.4f"%(M, e, (fact(M) * pow(e, m))/(fact(_m) * fact(m))) Thanks to anyone who has a crack at solving this =)
--- In aima-talk@yahoogroups.com, "inyourmind6684" <dtamayo@...> wrote:
>
> I'm looking to create a test file and successor function for BFS in
> the AIMA code. However, in order to instantiate a BFS I have to pass
> in a QueueSearch. I ran into the problem when trying to instantiate
> the QueueSearch. I know that QueueSearch extends the NodeExpander but
> I've tried several ways to instantiate it and I keep getting
> complaints from eclipse. Does anyone know how to create a QueueSearch
> so that eclipse doesn't complain?
>
> Thank you for your time.
>
Do we use the AIMA code examples, i.e. BFS and QueueSearch, for the
exercises in the book? Or, are we supposed to define and implement all
of the code for the exercises ourselves?
The code for QueueSearch begins as follows
"public abstract class QueueSearch .... "
The "abstract" keyword implies you cannot instantiate the class. You
need to instantiate one of its concrete subclasses (TreeSearch or
GraphSearch).
The demo and unit test classes have a dozen plus examples of how these
may be instantiated. The readme file explains the two hierarchies of
search and how they relate to each other.
"> I've tried several ways to instantiate it and I keep getting
> complaints from eclipse."
When this happens the next time, do try to understand what the error
message is trying to communicate. An attempt at doing this would have
exposed the "trying to instantiate an abstract class" error.
In other words, eclipse complains for a reason!
--- In aima-talk@yahoogroups.com, "inyourmind6684" <dtamayo@...> wrote:
>
> I'm looking to create a test file and successor function for BFS in
> the AIMA code. However, in order to instantiate a BFS I have to pass
> in a QueueSearch. I ran into the problem when trying to instantiate
> the QueueSearch. I know that QueueSearch extends the NodeExpander but
> I've tried several ways to instantiate it and I keep getting
> complaints from eclipse. Does anyone know how to create a QueueSearch
> so that eclipse doesn't complain?
>
> Thank you for your time.
>
I'm looking to create a test file and successor function for BFS in
the AIMA code. However, in order to instantiate a BFS I have to pass
in a QueueSearch. I ran into the problem when trying to instantiate
the QueueSearch. I know that QueueSearch extends the NodeExpander but
I've tried several ways to instantiate it and I keep getting
complaints from eclipse. Does anyone know how to create a QueueSearch
so that eclipse doesn't complain?
Thank you for your time.
--- In aima-talk@yahoogroups.com, "kiana" <blacksilk79@...> wrote:
>
> I understand the material in the chapter. However, the exercises
are
> completely confusing to me. Therefore, a discussion of the chapter
may
> clarify. For the 8-puzzle problem, I am not able to understand the
> existence of two disjoint sets of all possible states in which a
state
> from one set can't transform to a state in the other set by any
number
> of moves. I would assume any state can be reached by in other
state. In
> other words, there are situations (initial state - goal
configuration)
> in which the puzzle isn't solvable? Does the two disjoint sets exit
> because the problem becomes an NP-Complete problem for those states
> trying to reach the states in the other disjoint set. And, the 9!/2
> calculation for all possible states derives from this theorem of
> exactly half of the possible states transform into a given goal, is
> this true?
>
Discussions of the topics in the book leads to a better understanding
of the material. I need clarification of the topics in order to
answer the exercies, not necessarily the answer to the questions. In
order for me to understand the material further, I need to understand
the questions. The existence of the disjoint sets were discussed in
book, so I would like to elaborate on that topic. I don't understand
that section of the book. Thank you.
--- In aima-talk@yahoogroups.com, "kiana" <blacksilk79@...> wrote:
>
> I understand the material in the chapter. However, the exercises
are
> completely confusing to me. Therefore, a discussion of the chapter
may
> clarify. For the 8-puzzle problem, I am not able to understand the
> existence of two disjoint sets of all possible states in which a
state
> from one set can't transform to a state in the other set by any
number
> of moves. I would assume any state can be reached by in other
state. In
> other words, there are situations (initial state - goal
configuration)
> in which the puzzle isn't solvable? Does the two disjoint sets exit
> because the problem becomes an NP-Complete problem for those states
> trying to reach the states in the other disjoint set. And, the 9!/2
> calculation for all possible states derives from this theorem of
> exactly half of the possible states transform into a given goal, is
> this true?
>
I'm confused, any clarification is greatly appreciated.
--- In aima-talk@yahoogroups.com, ramanathan pl <ramkrshn36@...>
wrote:
>
> Hi,
>
> When I was going through the 8 puzzle example in fig. 3.4 of AIMA
2nd edition, I found that from the given start state (7 2 4 5 0 6 8 3
1), it is NOT possible to reach the given Goal state ( 0 1 2 3 4 5 6
7 8) since both the states belong to two disjoint sets and it is not
possible to transform from a state in one set to a state in another
set , immaterial of how many moves we make.
>
> Any similar comments and discussions appreciated.
>
> Thanks
> Ram
>
>
>
>
>
It's evident two disjoint sets of all possible states for the 8-
puzzle problem exist. However, I don't understand. I would assume it
is possible to reach any state from a given state. What are the
differences between the two disjoint sets? I am seriously confused.
______________________________________________________________________
_________
> Be a better friend, newshound, and
> know-it-all with Yahoo! Mobile. Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
>
I understand the material in the chapter. However, the exercises are
completely confusing to me. Therefore, a discussion of the chapter may
clarify. For the 8-puzzle problem, I am not able to understand the
existence of two disjoint sets of all possible states in which a state
from one set can't transform to a state in the other set by any number
of moves. I would assume any state can be reached by in other state. In
other words, there are situations (initial state - goal configuration)
in which the puzzle isn't solvable? Does the two disjoint sets exit
because the problem becomes an NP-Complete problem for those states
trying to reach the states in the other disjoint set. And, the 9!/2
calculation for all possible states derives from this theorem of
exactly half of the possible states transform into a given goal, is
this true?
At what level should I import the source code? should I just import
the aima level? or the src sublevel? Thank you for your time.
--- In aima-talk@yahoogroups.com, "Ravi Mohan" <magesmail@...> wrote:
>
>
> If you are having trouble with .project file, delete it. Use the
> "Import project from source" option in eclipse and it will generate a
> new .project file for you.
>
> Cheers,
> Ravi
>
> --- In aima-talk@yahoogroups.com, "inyourmind6684" <dtamayo@> wrote:
> >
> > I'm having trouble opening up the aima-java. I am using eclipse to
> > open the .project file. However, everytime I try to do this, I just
> > open up a blank workspace. There is no project defined and I have no
> > idea why. The very first time I did this, I saw the project and
> > everything. Then after that I seem to have lost the ability to view
> > it. I have tried unpacking the zip several times and even reinstalling
> > the eclipse program several times to make sure the settings were still
> > the same and have yet to be able to view the project again. Can anyone
> > help with this problem? Thank you for your time.
> >
>