Skip to content

Commit

Permalink
#19 change node and vehicle to defstruct
Browse files Browse the repository at this point in the history
  • Loading branch information
mck- committed Mar 13, 2012
1 parent 3f49366 commit 02da823
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions lib/class-definitions.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@
;; The node object
;; ----------------------

(defclass node ()
((id :reader node-id :initarg :id)
(xcor :reader node-xcor :initarg :xcor :initform nil)
(ycor :reader node-ycor :initarg :ycor :initform nil)
(demand :reader node-demand :initarg :demand)
(start :reader node-start :initarg :start)
(end :reader node-end :initarg :end)
(duration :reader node-duration :initarg :duration :initform 0)))
(defstruct node
(id 0 :type fixnum :read-only t)
(xcor 0 :type fixnum :read-only t)
(ycor 0 :type fixnum :read-only t)
(demand 0 :type fixnum :read-only t)
(start 0 :type fixnum :read-only t)
(end 0 :type fixnum :read-only t)
(duration 0 :type fixnum :read-only t))
;; --------------------------

;; The vehicle object
;; ---------------------------

(defclass vehicle ()
((id :reader vehicle-id :initarg :id)
(route :accessor vehicle-route :initarg :route)
(capacity :reader vehicle-capacity :initarg :capacity)
(speed :accessor vehicle-speed :initarg :speed :initform 1)))
(defstruct vehicle
(id 0 :type fixnum :read-only t)
(route 0 :type fixnum)
(capacity 0 :type fixnum :read-only t)
(speed 1 :type fixnum :read-only t))
;; ----------------------------

;; The problem object class
Expand Down

0 comments on commit 02da823

Please sign in to comment.