Vehicle Routing - Optaplanner - optaplanner

I am tweaking Vehicle Routing Problem to cater our business needs using the provided Optaplanner example.
Capacity = Total number of hours available to a vehicle in a day(X hours)
Demand = Time to move to a Customer + Serving Time at Customer's location
The problems I'm facing -
Scheduling should be done on day to day basis with new Customer orders added and removed dynamically. How to do?
(Assumption - Customer orders will be available before scheduling but new Customer order might come while scheduling)
How to reset the Capacity? (Every other day vehicles are renewed with X hours. Every other day vehicles will have X hours available again.)
Vehicle may not need to return to the Depot at the end of the day and can start from the Last Customer location to get to new Customer another day.
What if the vehicle consumes all it's available hours during the transit before reaching the Customers location? Will it result in ageing for that particular customer?
Any insights about any of the problems mentioned above are appreciated.

Related

Shopify POS for rental services

I want to know if Shopify POS allows selling of service through the POS?
Specifically speaking if the POS will be used in a computer laboratory rental whereas:
A customer walks in the store the cashier inputs time-in
Cashier inputs time-out then POS calculates total hours and total cost of the service.
Is this possible with Shopify POS?
You could set this up with a simple Shopify App. When the order is booked the App registers the time at the POS and the item is marked OUT. When the item is returned the POS user finds the order and marks the item as IN. Now the hours out are known. So apply those hours as a number of units (hours) and using a unit price (cost per hour), the order would be worth X. If it was nothing but a draft order, at that point it could be turned into a real order in exchange for the money.
You're welcome...

CVRPTW variant on optaplanner with load time in each customer

I'd like to add following restrictions to the CVRPTW problem, and know if it can be modeled on optaplanner:
1) Vehicles start in a garage, loaded in the customers and unloaded in a depot. After last unload, return to the garage
2) In each customer, the vehicle has a different volume to load, and a different time duration for the loading.
TW restrictions is global, every vehicles should start at time x and return to the garage at most on time z.
Thanks,
In the VRP examples in optaplanner-examples, it already has capacity and serviceDuration per TimeWinowedCustomer. All vehicles also return to the depot (= garage).
The only thing I see missing is an arrivalTimeBackAtTheDepot for a Vehicle, which is straightforward to calculate from the last customer's departureTime for each vehicle.

Does optaplanner out of box support VRP with multiple trips and no depot

I am working on a VRP with the following characteristics:
The vehicle can only pick up 1 customer at one time
The vehicle picks up a customer at a location and drops off the customer at the destination
After dropping off the customer the vehicle goes on to pick up another customer
There is no depot that vehicle needs to go to in between the trips .
The vehicle makes as many trips as it can in a day to pickup/drop-off customers
At the end of day, the vehicle goes back to its designated parking station
Essentially, it's like a taxi system. It seems to me that it's a VRP with multiple trips(VRPMT) and no depot (Open VRP). I'd like to know
Does optaplanner has support for VPRMT and OVRP out of box?
If VPRMT and OVRP are not supported out of box, how easy is it to modify the existing CVRP/CVRPTW examples to make it solve OVRP and VPRMT?
Maybe I am on the wrong track and it's not even a VRP. If so, what would be the right planning problem for the taxi like system?
Many thanks in advance!
No, the examples don't include pickup and delivery or multiple trips yet
Users have done it before to add Pickup and Delivery (which is easy if multiple customers cannot be in the vehicle at the same time (otherwise it's harder and I might add an example for that way some day). Multiple trips and open VRP should by easy (although I think your parking station is a depot and you probably don't have multiple trips, just multiple customer sequentially in the same trip).
This is definitely a variant of VRP. Do note that every business has their own flavor of VRP. You'll always find some custom constraints (now or later in the development process). OptaPlanner allows you to add those custom constraints as needed.
Try this: Take the OptaPlanner VRP example, rename Depot to ParkingStation. Split up Customer's Location into pickupLocation and deliveryLocation and adjust the score rules so the soft score is the sum of:
all pickup to delivery distances
all delivery to next pickup distances
each parking to first pickup distance
each last delivery to parking distance

Resource scheduling logic

I've to schedule few resource for booking. Below is my logic
Sample:
I've to schedule Delux(2) and Classic(1) room for a year. So I'm inserting 1095 records(730+365-a row for every day each resource).
Database:
table(SID,SDATE,ROOMID,STATUS)
For the particular day, I'm checking the schedule count which has status as 'available' and allowing to book.
Is the logic correct one? or any other logic which reduce number of record insertion?(Note:resource count per day may vary)
Why can't you use START_DATE and END_DATE instead of the SDATE to store intervals?
For the particular day you can ask the same status for intervals where the day between the interval's START_DATE and END_DATE.
Even better to track only booked intervals all the rest are free. So all rooms are free except defined intervals for already booked ones.
If I understand the problem correctly you have a variable resource pool that you receive somehow. Assuming this is in the form of room X of type T from date A to date B.
I would store this into a table "availability", so at any time you can have a view on overall availability per day. If you couple this with StanislavL answer you would have two tables one for available rooms and one for bookings:
availability(availability_id,room_id,date_from,date_to)
booking(booking_id,room_id,date_from,date_to)
room(room_id,type,name,address,..)
Number of available rooms per day is obtained by subtracting via NOT IN clause the booked rooms from the available ones. Also, when you need to book a room you can check in the availability table if this is actually possible.

Renting, Booking and Schema.org

Is there any way to express the idea of time (as in day or weeks) for a booking or a rental using Schema.org or/and GoodRelation?
It could be the combination of a product and an offer, as described in this question, but it doesn't really express the idea of the same product being available at different times.
First, use the new version of schema.org (0.99) with the itemtype http://schema.org/Offer. Make clear that you have a rental offer using the property
- businessFunction with http://purl.org/goodrelations/v1#LeaseOut as the value.
The validity of the offer is specified using the properties validFrom and validThrough (i.e. the period of time during which one can accept your offer).
For multiple alternative rental periods, create multiple offer entities.
The availability period and the minimum / maximum duration of a stay is specified using
eligibleDuration: The duration for which the given offer is valid.
availabilityStarts: The beginning of the availability of the rental object.
availabilityEnds: The end of the availability of the rental object
The UN/CEFACT unit code for days is DAY, for months it is MON.
The billing increment etc. is modeled using http://schema.org/UnitPriceSpecification.
If you need detailed patterns, please contact me via http://www.heppresearch.com/contact. We built the new e-commerce module for schema.org.