In the AI textbook I’m reading, there is a state planning example. Part of the example is:
“There are 10 airports and 50 planes. Each plane can be at one of 10
airports, so there are 50^10 states.”
I don’t understand. Shouldn’t there be 10^50 states, since there are 50 planes, and ten choices for the airport each plane is located at?
Related
Suppose that we have a M*N maze and some and there are K dogs in different cells of this mase looking for their houses (their unique houses are also located in some cell in the maze). in each step, all of the dogs can stay at their location or move to an adjacent cell in the maze (the eligible moves are: up, down, right, left if possible). what could be a good state space for this problem?
Unique houses mean that each dog has its specific house located somewhere on the maze.
Two dogs can stand same cell too.
I personally think that the sum of manhattan distances for each dog from its house could be a good heuristic but I could not define a good state space myself.
Here is a link to a picture of a sample for k=2 and a 5*5 maze:
Example
Because all of the animals are independent (they don't block each other and they have unique individual goals), you shouldn't model the joint actions between all agents. You are really solving K independent pathfinding problems, where each one can use the manhattan distance heuristic individually, given 4-connected movement. If you solve them jointly you make the problem exponentially larger when it doesn't have to be.
There are lots of ways of building better heuristics or re-using search information, but that's a different question.
I have an AI class and we have to make projects. I chose to do a genetic algorithm and since I'm new to the concept I have couple of questions. I have researched and I get the idea and followed Coding Train's video on simple genetic algorithm without any problem. However i have seen multiple videos on YouTube where cars evolve, and I don't get how do they have population of lets say 20 if only one car is being rendered to the screen. I wanna try and create Pong like game(I'll use basic physics engine) where Player A is computer, which always follows the Y coordinate of the ball thus can't lose, and Player B is supposed to evolve using genetic algorithm. How would I evolve Player B every time it loses. What would the chromosomes be? What would the population be? If you can give me any advice I would be very thankful
Regarding the cars, it's most likely that each car in the generation is being evaluated and rendered sequentially. Suppose the population size is 20, the first 20 cars you see would be the initial population. The next 20 cars you see would be the second generations population and so on.
Regarding Pong, you need to decide on a fitness function for your Player B. If Player B always loses then perhaps your fitness function could be how long it is able to last before it loses. To determine your chromosome you first need to decide how you will control Player B's paddle. The chromosome would then be some set of design variables that affect that system. For example, you might use a small neural net where your chromosome encodes the weights of the connections. Your population is a set of chromosomes used to produce the next generations set of chromosomes through crossover and mutation.
Bouquets of flowers are a fairly accurate analogy for our problem domain.
For an example, let's assume a test image of thirty flowers:
- Roses: 10
- Poppies: 9
- Daisies: 5
- Lillies: 5
- Sunflowers: 1
Is there a training approach that might get Watson to look at pictures of bouquets and be able to reply with a density of a given flower type, or even a ratio or something?
If there are any ideas, should we train with images of single/isolated or multiple/grouped of each type of flower?
...or a combination of both?
ANY ideas/suggestions would be welcome!!!
EDIT:
Alternatively, rather than making classes by flower-type, we could class by action-needed ??
But, maybe that's a different enough idead to be it's own question.
In part, it depends on how much control you have over the images that you need to classify, and the granularity of the classification that you need to make. If, for example you're guaranteed to always have a top down view of the bouquet that shows all the different flowers clearly and other extraneous objects are generally not in the scene, then you probably could train a classifier for something like five density levels for each flower type. For example, the Daisy classifier would have five classes: 0 to 20% daisies, 20 to 40% daisies, 40 to 60% daisies, 60 to 80% and over 80% daisies.
i am running a dating website, or better say, try to. I want to be as generic
as possible in terms of, coverage for countries.
Since it's a local dating oriented website, i have to keep track of cities
and so on so i am running into a few problems:
I need to have information about cities, people could join from
(a country i don't know anything about, i really can't decide about a city
or anything)
When people join from different countries, they would like to see people
near by. How would you approach this sort or problem?
This may seem like 2 easy points but they really make me some trouble these
days.
** Try to approach them as Database related issues **
I circled around SE and find this to be the best point to ask, not any other
SE website.
Thank you very much
The full name of a city in the USA is {country_name, state_name, city_name}. I say that assuming that, on a global scale, what I call state_name is not unique. I can easily imagine some region of a Latin American country being named "Nevada" or "Colorado".
You also have the problem of spelling. An American living in Germany might say she lived in Cologne, North Rhine-Westphalia, Germany. A German living there would call it "Köln".
"Nearby" is an even tougher nut to crack. I used to live in a big city. It wasn't unusual to drive an hour on an Interstate highway to pick up my date. I thought of that as "nearby". Now I live in a small city. Now 30 minutes seems like a long drive, but it's probably only 15 or 20 miles instead of 65 or 70.
If you live in a border town, 15 miles might be in a different country. Maybe two different countries.
I think your best bet is to use a geolocation API or service to get the latitude and longitude of new cities when they're inserted. The calculation of distance given two points is straightforward, but it leads to badly performing queries unless you use a bounding box. (You don't want to calculate the distance to every city in Texas to find people "near" Waco.)
Get the latitude/longitude for all of the cities. Don't worry about exact distances.
Play with excel and find the maximum change for latitude and/or longitude (Δlat or Δlong) for given distances (10miles, 25 miles, 50 miles), and then when you search for others, just search the database for within (Firstuser'sLongitude +/- Δlong) and within (Firstuser'sLatitude +/-Δlong).
I don't think people will mind the difference between 10miles and 10*2^0.5 miles.
'Proximity' is a strategy game of territorial domination similar to Othello, Go and Risk.
Two players, uses a 10x12 hex grid. Game invented by Brian Cable in 2007.
Seems to be a worthy game for discussing a) optimal algorithm then b) how to build an AI.
Strategies are going to be probabilistic or heuristic-based, due to the randomness factor, and the insane branching factor (20^120).
So it will be kind of hard to compare objectively.
A compute time limit of 5 seconds max per turn seems reasonable => this rules out all brute-force attempts. (Play the game's AI on Expert level to get a feel - it does a very good job based on some simple heuristic)
Game: Flash version here, iPhone version iProximity here and many copies elsewhere on the web
Rules: here
Object: to have control of the most armies after all tiles have been placed. You start with an empty hexboard. Each turn you receive a randomly numbered tile (value between 1 and 20 armies) to place on any vacant board space. If this tile is adjacent to any ALLY tiles, it will strengthen each of those tile's defenses +1 (up to a max value of 20). If it is adjacent to any ENEMY tiles, it will take control over them IF its number is higher than the number on the enemy tile.
Thoughts on strategy: Here are some initial thoughts; setting the computer AI to Expert will probably teach a lot:
minimizing your perimeter seems to be a good strategy, to prevent flips and minimize worst-case damage
like in Go, leaving holes inside your formation is lethal, only more so with the hex grid because you can lose armies on up to 6 squares in one move
low-numbered tiles are a liability, so place them away from your main territory, near the board edges and scattered. You can also use low-numbered tiles to plug holes in your formation, or make small gains along the perimeter which the opponent will not tend to bother attacking.
a triangle formation of three pieces is strong since they mutually reinforce, and also reduce the perimeter
Each tile can be flipped at most 6 times, i.e. when its neighbor tiles are occupied. Control of a formation can flow back and forth. Sometimes you lose part of a formation and plug any holes to render that part of the board 'dead' and lock in your territory/ prevent further losses.
Low-numbered tiles are obvious-but-low-valued liabilities, but high-numbered tiles can be bigger liabilities if they get flipped (which is harder). One lucky play with a 20-army tile can cause a swing of 200 (from +100 to -100 armies). So tile placement will have both offensive and defensive considerations.
Comment 1,2,4 seem to resemble a minimax strategy where we minimize the maximum expected possible loss (modified by some probabilistic consideration of the value ß the opponent can get from 1..20 i.e. a structure which can only be flipped by a ß=20 tile is 'nearly impregnable'.)
I'm not clear what the implications of comments 3,5,6 are for optimal strategy.
Interested in comments from Go, Chess or Othello players.
(The sequel ProximityHD for XBox Live, allows 4-player -cooperative or -competitive local multiplayer increases the branching factor since you now have 5 tiles in your hand at any given time, of which you can only play one. Reinforcement of ally tiles is increased to +2 per ally.)
A former member of the U of A GAMES group here.
That branching factor is insane. Far worse than Go.
Basically, you're hooped.
The problem with this game is that it is not deterministic due to the selection of a random tile. This actually adds another layer of nodes between each existing layer of nodes in the tree. You'll be interested in my publications on *-Minimax to learn about techniques for searching in stochastic domains.
In order to complete one-ply searches before the end of this century, you're going to need some very aggressive forward pruning techniques. Throw provably best move out the window early and concentrate on building good move ordering.
For general algorithms, I would suggest you to check the research done by the Alberta University AI Games group: http://games.cs.ualberta.ca Many of the algorithms there guarantee to find optimal policies. However, I doubt you're really interested in finding the optimal, aim for the "good enough" unless you want to sell that game in Korea :D
From your description, I have understood the game to be a two-player with full-observability i.e. no hidden units and such and fully deterministic i.e. player's actions outcomes do not require rolling, then you should take a look at the real-time bounded-search minimax derivatives proposed by the U Alberta guys. However, being able to do bound as well the depth of the backups of the value function would perhaps be a nice way to add a "difficulty level" to your game. They have been doing some work - a bit fishy imo - on sampling the search space for improving value function estimates.
About the "strategy" section you describe: in the framework I am mentioning, you will have to encode that knowledge as an evaluation function. Look at the work of Michael Büro and others - also in the U Alberta group - for examples of such knowledge engineering.
Another possibility would be to pose the problem as a Reinforcement Learning problem, where adversary moves are compiled as "afterstates". Look that up on the Barto & Sutton book: http://webdocs.cs.ualberta.ca/~sutton/book/the-book.html However the value function for a RL problem resulting from such a compilation might prove a bit difficult to solve optimally - the number of states will blow up like an H-Bomb. However, if you see how to use a factored representation, things can be much easier. And your "strategy" could perhaps be encoded as some shaping function, which would be speeding up the learning process considerably.
EDIT: Damn English prepositions