簡體   English   中英

救護車搶救作為車輛路線(載人,有時間限制)

[英]Ambulance rescue as vehicle routing (capacitated, time bound)

這是我要解決的問題:

  • 有一個城鎮,病人在(x,y)位置,並且他們會死亡。
  • 患者需要在死亡之前到達醫院才能得到救助。
  • (x,y)的一堆醫院有一些救護車,一次最多可以接診四名患者,並將他們送往任何一家醫院。
  • 一輛救護車從醫院開始,要旅行多次,並且可以在任何一家醫院結束。
  • 我們應該保存盡可能多的患者。
  • 完整的問題描述在這里: http : //cs.nyu.edu/courses/fall15/CSCI-GA.2965-001/ambulance.html

我正在嘗試使用jsprit解決此問題,但無法弄清楚如何執行以下操作:(我想知道我應該研究API的哪一部分)

1)指定有有限的救護車,但它們可以多次旅行。

  • 設置VehicleRoutingProblem.Builder.setFleetSize(FleetSize.INFINITE)會這樣做嗎? 該代碼未記錄確切的功能。

2)限制患者在死亡或離開醫院之前被送往醫院。

  • Shipment.Builder.newInstance(“ ...”)。setDeliveryTimeWindow(time_of_ Patient_dying)是否可以實現此目的?

3)對於到達醫院進行分娩的任何救護車,增加1分鍾的卸載時間。

  • 不知道該看API的哪一部分。

4)讓救護車將病人送至任何醫院,從而選擇更好的路線。

  • 不知道該看API的哪一部分。

到目前為止,這是我的代碼:

// make vehicle routing problem builder
VehicleRoutingProblem.Builder vrpBuilder =
    VehicleRoutingProblem.Builder.newInstance();

// make vehicle type
VehicleTypeImpl.Builder vehicleTypeBuilder =
    VehicleTypeImpl.Builder.newInstance("ambulanceWithFourBeds")
        .addCapacityDimension(0, 4);
VehicleType vehicleType = vehicleTypeBuilder.build();

// putting multiple vehicles at every hospital
List<Location> locations = state.getVehicleLocations();
int counter = 0;
for (Location location : locations) {
  VehicleImpl.Builder vehicleBuilder =
      VehicleImpl.Builder.newInstance("ambulance_" + counter++);
  vehicleBuilder.setStartLocation(location);
  vehicleBuilder.setType(vehicleType);

  vrpBuilder.addVehicle(vehicleBuilder.build());
}

List<Patient> patients = state.getPatients();
counter = 0;
for (Patient patient : patients) {
  Shipment shipment = Shipment.Builder.newInstance("patient_" + counter++)
      .addSizeDimension(0, 1).setDeliveryTimeWindow(patient.getTimeWindow())
      .setPickupLocation(Location.newInstance(patient.x, patient.y))
      .setDeliveryLocation(patient.getAssignedClusterCentroid()).build();

  vrpBuilder.addJob(shipment);
}

vrpBuilder.setRoutingCost(new ManhattanCosts(vrpBuilder.getLocations()));

VehicleRoutingProblem problem = vrpBuilder.build();

嗯,我仍在學習如何提出問題方面的知識。 我幾乎解決了上述問題。 這是我的結果(以及指向整個代碼的鏈接):

  1. 指定有有限的救護車,但它們可以多次旅行。 -將FleetSize設置為FINITE
  2. 限制患者在死亡或離開醫院之前被送往醫院。 Shipment.Builder.newInstance(“ ...”)。setDeliveryTimeWindow(time_of_ Patient_dying)實現了此目的。
  3. 對於任何一輛到達醫院進行分娩的救護車,增加1分鍾的卸載時間。 -繼承VehicleRoutingTransportCosts並將所有距離和時間加1。

  4. 讓救護車將病人送至任何醫院,從而選擇更好的路線。 -仍未解決。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM