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.
카테고리
도움말 센터 및 File Exchange에서 Direct Search에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!