artificial intelligence robot.

zakirox:
i am preparing my coding now onward. i just ordered a robot chassis on ebay and i am waiting till it arrive ;). here is a piece of my code below.

What you coded is not artificial intelligence - it's also not an expert system. It is merely a simplified decision tree of sorts to potentially avoid obstacles based on what the sensor(s) report.

There is no self-learning involved in the decision tree; it will always make the same decisions given the same inputs.

I am not saying that such code can't work - I am just saying it is not artificial intelligence. An artificial intelligence algorithm - if it were implemented - would actually behave quite poorly at first. The robot would blunder into things, wouldn't be able to get "un-stuck", etc. But over time, it should be able to learn how to avoid obstacles (with only the occasional blunder).

Now - that isn't to say that eventually, it wouldn't "evolve" the same rules that you (as a programmer) could hard code into the system in the beginning. What it might do, though, is come up with a far better set of rules that would work for most cases. Then again, it might not - it might actually evolve a set of rules that are sub-optimal (this is called "getting stuck in a local minima").

I am not sure what it is you are wanting to implement; a simple set of rules for obstacle avoidance, like you have coded (note - I didn't review the code enough to know if your code will actually work as you intend it to) - or if you are wanting a robot to self-learn those rules by blundering around and figuring out the rules itself...