genetic algorithm for car parking assignment
Show older comments
I have:
- a set of cars looking for parking places.
- a set of parking garage managing each a set of these parking places.
What I want is to assign cars to these parking garages while minimizing the total cost. So it is basically an optimization problem. Moreover, I have the condition that for each car, the distance between its destination and the parking garage has to be less than a certain threshold distance otherwise, it won't be accepted.
I tried to solve the problem with simulated annealing but there is nowhere to put the constraint about the threshold distance. I tried to use a penalty in the cost function (a constant big value) to not choose the solutions which do not correspond with no avail. I still get the solutions that should not be accepted.
I found that the genetic algorithm has the possibility to add constraints but I don't know how to customize it to my data. The example of traveling salesman problem is not helping me much.
Any idea on how either to modify simulated annealing to support my condition (which would be the best) or how to shift to genetic algorithm.
6 Comments
jgg
on 8 Mar 2016
Do you have any info an how your data is set-up? It's pretty easy to add constraints:
x = ga(fitnessfcn,nvars,A,b)
if your first variable corresponds to threshold distance, you can set:
A = [1,0,0,0...,0];
b = [cutoff value];
More info would be helpful!
student beginner
on 8 Mar 2016
Edited: student beginner
on 8 Mar 2016
Image Analyst
on 8 Mar 2016
Not sure I understand the grammar of "a set of parking garage managing each a set of these parking places" What exactly does that mean? Do you really mean "a set of parking garages where each garage manages its parking places" or do you mean something different?
student beginner
on 8 Mar 2016
Image Analyst
on 26 Dec 2018
Try this: Search Vision Bibliography for parking
You will find algorithms there. Pick one and code it up.
Answers (1)
Walter Roberson
on 8 Mar 2016
0 votes
You have a discrete optimization problem: car(K) is to be allocated garage x(K), x(K) in 1 : number_of_garages, minimize sum( distance(K, x(K)) for all K, subject to the constraint that the number of cars going to each garage is less than the capacity for the garage. The cars that are too far away, set their distance to infinity -- any non-infinite value will be less than infinity so if there is even one feasible solution found then the constraints will not be violated.
1 Comment
student beginner
on 8 Mar 2016
Categories
Find more on Direct Search in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!