genetic algorithm for car parking assignment
古いコメントを表示
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 件のコメント
jgg
2016 年 3 月 8 日
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
2016 年 3 月 8 日
編集済み: student beginner
2016 年 3 月 8 日
Image Analyst
2016 年 3 月 8 日
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
2016 年 3 月 8 日
Image Analyst
2018 年 12 月 26 日
Try this: Search Vision Bibliography for parking
You will find algorithms there. Pick one and code it up.
回答 (1 件)
Walter Roberson
2016 年 3 月 8 日
0 投票
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 件のコメント
student beginner
2016 年 3 月 8 日
カテゴリ
ヘルプ センター および File Exchange で Direct Search についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!