I'm playing around with core.logic, and have this code so far:

https://gist.github.com/3981557

There are 2 people and 3 tasks. Each task has a start time (you can't start 
the task until this time or later), and end time (you must finish the task 
by this time), and a duration (how long it takes to perform the task). Time 
is just an integer.

My answer includes 3 vectors of the form: [task-id, person-id, start-time, 
end-time], where person-id is the person doing the task, and 
start-time/end-time are when the task was done (must fall within the start 
and end times of the task).

I have two goals: one of them ensures that the second element of each 
vector is a person, and the other ensures that the times are correct.

Now, I want to prevent the same person from doing two tasks at the same 
time. In other words, for any two vectors in the result, either the 
person-id must be different or the start/end times must not overlap.

I've tried some things (using conde, !=, and <=fd), and can't seem to get 
it to work. Is this easy to do? Am I going about this entire problem the 
wrong way?

Also, how can I make time-intervalso (or any of my code) look better? It 
doesn't look nearly as elegant as the core.logic code I've seen elsewhere.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to