Skip to content

ThoneA/pdp_utils

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UiB INF273-Meta-Heuristikkar Pickup and Delivery Problem utils

This repo, has been reconstructed from the original.

If you get MemoryError try this:

Change to the branch: if crash This branch does not have caching, which is probably the main reason for the MemoryError :/

If it crashes try this:

Only run one and one file.

If it runs to slow:

Try to remove OP5 in the escape_algorithm().

Requirement

  • numpy

Usage

1) You can install the library by typing the following in terminal:

python setup.py install

2) You can load the problem instance using the following line

from pdp_utils import load_problem

prob = load_problem(*PROBLEM_FILE_ADDRESS*)

The function returns dictionary that includes the following information about each problem instance:

  • 'n_nodes': number of nodes
  • 'n_vehicles': number of vehicles
  • 'n_calls': number of calls
  • 'Cargo': information about each call
  • 'TravelTime': for each vehicle the travel time from one node to another
  • 'FirstTravelTime': for each vehicle the travel time from starting point to each node
  • 'VesselCapacity': the capacity of each vehicle
  • 'LoadingTime': for each vehicle the loading time of pickup of each call (-1 indicates not allowed)
  • 'UnloadingTime': for each vehicle the un-loading time of pickup of each call (-1 indicates not allowed)
  • 'VesselCargo': the list of allowed calls for each vehicle
  • 'TravelCost': for each vehicle the travel cost from one node to another
  • 'FirstTravelCost': for each vehicle the travel cost from starting point to each node
  • 'PortCost': the cost of answering a call for each vehicle (-2 indicates not allowed)

3) You can check the feasiblity of your asnwer like below:

from pdp_utils import feasibility_check

feasible, log = feasibility_check(SOL, prob)

print(log)

4) You can check the cost function of a sulotion as below:

from pdp_utils import cost_function

cost = cost_function(SOL, prob)

About

inf273

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%