You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are some complications using my A* restaurant code in SimCity201.
In the restaurant, all waiters share the same grid and have the same locations masked off limits for traversals by the waiters: the tables, the customer waiting area, and the cook's area.
When each waiter computes a walk, A* sees the same grid with the same off limit areas and with grid location occupied by the waiters also unavailable.
They all walk the same grid, resolving conflicts when two waiters want to walk into the same grid location. Remember, at the time of computing the walk, all grid locations in the computed walk WERE available. During runtime when waiters are walking, they could be competing for the same grid location.
SimCity is different in several ways:
There is a shared grid for all agents to move on, just like in the restaurant.
However, each agent has different grid locations on which it can move. A PersonAgent can only walk on sidewalks and street crossings. A vehicle can only move on roads.
So each agent type must move only on squares of the right type I think the best solution is to take my AStarTraversal class, and make its expandFunc(Node n) abstract. ExpandFunc as written works for Restaurants, i.e. any position on the grid and with a permit was available. However, vehicles need and ExpandFunc that only looks at roads, while a person needs an ExpandFunc that only looks at sidewalks and street intersections. So, you will need an AStarTraversalForVehicles class and AStarTraversalPerson class that each extends the now abstract AStarTraversal class. only the ExpandFunc is different.
The text was updated successfully, but these errors were encountered:
There are some complications using my A* restaurant code in SimCity201.
SimCity is different in several ways:
The text was updated successfully, but these errors were encountered: