Park search algorithm - python-2.7

So they gave me an assignment in artificial intelligence (given in the images(link) below). I do not really know how to go about it in python. I would like to implement it in python. If anyone could help me with the code to this homework, I would really appreciate.parking lot
I tried implementing this in python but i just could not figure it out

Related

Using NEAT C++ for custom AI

I am working on a project which uses a control algorithm to complete a task. The project already has a simulator created for it. I would like to experiment and see if a NEAT AI could do a better job and replace the current control algorithm. I've read through the NEAT publication Competitive Coevolution through Evolutionary Complexification. I have also looked at the original c++ implementation.
I was hoping it would be possible to use and existing implementation of NEAT and combine it with the existing simulator in order to train an awesome control algorithm. There is not much documentation on how i could modify the original NEAT C++ for my needs, are there any tutorials or other implementation which will suit my needs?
Thanks
Answer is little late, but maybe it will help someone else.
I do not know if you read initial Evolving Neural Networks through Augmenting Topologies, but there is explained. About code, only documentation is that one in package that you referenced.
I also found that book "AI Techniques for Game Programming" by Mat Buckland had chapter dedicated to NEAT algorithm with NEAT code (different from original referenced), but maybe it could give you some insight into code.
UPDATE:
Most easiest way is to check out experiments included in code. From there you can see that you just call NEAT algorithm and define function to calculate fitness.

how to match soft aggregate features(eyes,nose,mouth) using some statistical method?

I know a little bit of ML, and want to implement a learning system by myself,but do not know how to do.Any one can give me a demo or use other method to compare faces?
Here is a related post: https://stackoverflow.com/questions/14079794/how-to-recognize-face-by-geometric-feature-such-as-eyes-nose-mouth.
One can not reasonably answer this question bassed on the above information because of sheer vastness of the subject.
For the start you should know that these problems are usually solved using Machine Learning techniques like Neural Networks. You said you know a bit about ML but as IMHO you might want to read more or take an online Course on Machine learning.
There are some good Courses on Coursera.org one that I like is Machine Learning by Andrew Ng.
These Methods are also described in above mentioned course and there are some good assignments too, which will help you to get the detailled idea behind machine learning.

Learning Clojure by reading core.clj

I came across the tweet today:
Start each day by reading the implementation of a function or macro in Clojure's core.clj.
My Clojure knowledge is really basic, I can hardly read other's Clojure (or Lisp) code.
Can I do well with core.clj, especially I have the feeling it is full of complicated macros?
I think a better place to start is by doing a project; anything that interests you and seems manageable is good.
core.clj is not readable right now; perhaps the latter half is, but the first half isn't something I'd wish on anyone as an introduction to the language. The truth is, even if you read it very carefully, you'd not have a solid idea of what was going on without also reading a lot of Java code, too.
Make an asynchronous text-based game (technomancy—Phil Hagelburg—has a nice one to look through on his Github, though it's a little dated by now)
Scrape websites using the Enlive library.
Maybe just solve some math problems, and/or
Graph things using Incanter.
Build first. Once you acquaint yourself with the tools you are using, start reading them. The libraries mentioned here are well written (you can't go wrong with anything by Christophe Grand, for instance), and once you start using them, you'll understand what they do, which makes it much simpler to figure out the why and how later.
That tweet is probably a great idea once you have enough experience to be able to read Clojure code well enough to understand what is going on.
Before that point, I'd recommend gaining a strong familiarity with the language by writing a lot of small mini-programs. It's best to learn by doing, after all.
I personally found Project Euler very useful while I was learning Clojure.
You might also take a look at the Clojure Koans, though they may be a bit beginner-oriented for you, depending on how much Clojure you already know.
As a good starting point, I would recommend 4Clojure. It looks similar to Project Euler and Code Katas, but has more forgiving learning curve.
There's a lot I don't understand in it, but there's also a lot I do, and it's fascinating looking at the language getting bootstrapped from its minimal initial implementation.
Another place to look for little projects to get you going would be any of the Kata repos. My personal favorite at this point is Coding Kata.org, but there's also Coding Dojo, Ruby Koans (with a little translation effort), and of course Google.
Try to do one of those a day and you'll quickly pick up the language.
Try reading the Clojure contrib libraries or look at some Clojure projects on github to get a better feel for idiomatic Clojure code.
The advice above is good. Another fine example of learning-by-doing is well illustrated here by the creator of Ruby on Rails: How Do I Learn to Program? I hope you have an app that you care about that you could just go for in Clojure.
I find the clojure.core a good way to find ideas of how things are implemented, as more of a reference guide. As noted earlier, the early parts or neither pretty nor exemplary. However, the later parts can be a good example especially when needing to write a function that is close to core function but different.

What C++ projects should I start? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 12 years ago.
Improve this question
I'm a high school student, and I have a decent amount of programming experience (HTML, Javascript, PHP, Actionscript 3.0). I know C++, but unlike the other languages I know, I have never actually made any decent sized projects with it. I am puzzled at what kind of project I should start, as there are so many things you can do with C++.
I just want some experience making something - but right now I don't know what I want to do!
HELP ME!
Find some open source projects and offer your help. You get to see other's code and have a goal on what to develop.
Find something that interests you. That will keep your attention the longest.
Pick something you're either passionate in, or something that might help you at home.
If you do that, then you have a vested interest in it rather than it being just another application.
For me, I wrote a small system to keep track of my customers. Now I know there are any number of applications that do that but I just wanted something small and custom so it really worked for me.
After that, when it was working, I then went back and refactored etc.
I see this question quite often. My reply is always the same. Programming is about scratching an itch. First find something that interests you and doesn't have a solution (or at least a good one). That's the itch.
Next sort out the best solution. It may be C++, .Net, Java or any one of a hundred other languages. The key is to pick the right tool for the job. If you try and push the square language in the round problem you will fail.
Programming is not about any one language. It's about finding the best solution to a problem and implementing it well using the right tools. This is what makes the difference between someone who knows a programming language, and someone who solve problems. The first are a dime a dozen, the second and worth their weight in gold.
Write a bitmap parser and viewer entirely from scratch, don't use any existing libraries. If you want an even bigger challenge, write a jpeg parser, that will require writing a huffman decompression algorithm and all sorts of other goodies.
I did this in java recently for a challenge, the program was rubbish but the amount of things I learnt made it worth while.
You could geek it up and create a complicated RPG (Maybe start with a simple form or console based game to get logic than maybe move on to directx or something).
I made an RPG myself but really never got to directx... yet. It can be fun because the game can be about whatever you want, your imagination is the only limitation. Figuring out the logic is a great way to stimulate your brain and learn new techniques in the process.
Try and find a copy of The OpenGL Programming Guide and have fun with some graphics programming. Old editions can usually be had cheaply.
The examples are all in C, not C++, but its good to get some experience in C too.
Also, see if your school or community hosts programming contests. One of my first large programs was a game for a junior-high level contest (though that was a long, long time ago).

learn and practice c++

I'm trying to learn c++ and I really want to do a lot of coding but I'm not sure what I can code.. Tbh, book exercises are not very interesting to me (usually because they're just too short). I like to code OS related stuff like I/O stuff..
I'm thinking of looking at linux and try mimicking some of the tools there.. is that a good idea?
Rewriting tools is a good idea - my C++ professor made us rewrite all the standard library string functions by hand before we were allowed to use them in our homework assignments so that is something that may help you as well. You could also check out Project Euler.
Here's a good task that involves I/O, has interesting algorithm, is not too simple, not too difficult, and can even have practical application:
Write a simple compressor / decompressor.
Simple ideas to start with: LZW, Huffman codes.
I write stuff I'm interested in ... games for example. Poker games or blackjack games. I also take existing libraries and see if I can make better versions of their stuff, like try and make a QuickSort that outperforms the Framework version. Some day I will write a chess game, but that will take some time. :)
Write a language! Make C# compile to Sparc V9 assembly (just kidding.) But seriously, I think, writing a small compiler that produces actual machine code is one of the greatest ways to learn a great deal about software and hardware (and operating systems, and libraries, etc. etc.) and pick up lots of useful skills along the way. Here's the The Dragon to get you started :)
You can try getting involved in some open-source projects if you are wanting to write code. If you find a project that has some use to you personally, it is going to greatly increase your interest levels and decrease the likelihood that you'll get bored with it and move on to something else. Plus you'll be able to get some feedback from other developers on the same project.
Try TopCoder. They're competition applet has hundreds of example programming problems. Some of them are sure to be more interesting than the exercises in the books, and you have the added bonus of seeing how your problem solving abilities measure up to other users.