Skip to content


Fix to issue #13 #16

merged 1 commit into from

2 participants


Hi Marc!

Sorry, you're right. The previous fix was not really ok. That's what happens when you rush things before dinner :-)

This new patch should solve the issues. I tested on the repl and there were no complains and the values seem fine. However, you're the best tester.

Hope this time it's really ok!

@mck- mck- merged commit bc2b3e7 into mck-:master

Thanks for the patch Jorge, it seems to work fine now

Don't worry, I learned a few new features with git/github in the meantime ;)


Ok, I'm glad it's working! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 19, 2012
  1. @jorgetavares

    Fix to issue #13

    jorgetavares committed
Showing with 20 additions and 4 deletions.
  1. +20 −4 lib/init-macros.lisp
24 lib/init-macros.lisp
@@ -75,12 +75,28 @@
"Creates the appropriate <Problem> object from the inputs. Extra key attributes only accept lists that are of equal length to node-coords-list or fleet-size (depending on what attributes it sets). With only the demands-list and capacities, creates a CVRP problem. With time-windows, creates a VRPTW problem. When durations and speeds are not provided, defaults to 0 and 1. When plot-filename is not given, it will plot in \"plots/name.png\"."
(with-gensyms (network fleet drawer)
`(let* ((,network (create-nodes ,node-coords-list
- ,@(when demands `(:demands ,demands))
+ ,@(when demands
+ `(:demands (if (listp ,demands)
+ ,demands
+ (make-list (length ,node-coords-list)
+ :initial-element ,demands))))
,@(when time-windows-list `(:time-windows ,time-windows-list))
- ,@(when durations `(:durations ,durations))))
+ ,@(when durations
+ `(:durations (if (listp ,durations)
+ ,durations
+ (make-list (length ,node-coords-list)
+ :initial-element ,durations))))))
(,fleet (create-vehicles ,fleet-size (aref ,network 0) ,to-depot
- ,@(when capacities `(:capacities ,capacities))
- ,@(when speeds `(:speeds ,speeds))))
+ ,@(when capacities
+ `(:capacities (if (listp ,capacities)
+ ,capacities
+ (make-list ,fleet-size
+ :initial-element ,capacities))))
+ ,@(when speeds
+ `(:speeds (if (listp ,speeds)
+ ,speeds
+ (make-list ,fleet-size
+ :initial-element ,speeds))))))
(,drawer (make-instance 'drawer
:min-coord (get-min-coord ,node-coords-list)
:max-coord (get-max-coord ,node-coords-list)
Something went wrong with that request. Please try again.