On Tuesday, October 30, 2012 6:48:28 PM UTC-5, David Nolen wrote:

> On Tue, Oct 30, 2012 at 1:11 PM, Anthony Rosequist 
> <anthony....@gmail.com<javascript:>
> > wrote:
>
>> I'm playing around with core.logic, and have this code so far:
>>
>> https://gist.github.com/3981557
>>
>
> It might help to understand exactly what kind of output were you expecting.
>
> David
>

Thanks for the quick reply, David. The little bit that I've seen of 
core.logic has been mind-blowing so far.

My code is outputting ([[1 A 0 5] [2 A 0 9] [3 A 0 3]]) now, which is 
"wrong" because person A is doing all three tasks between times 0 and 3 
(and two of the tasks between times 4 and 5).

I would expect something like ([[1 A 0 5] [2 *B* 0 9] [3 A *6 9*]]), where 
person A is performing tasks 1 and 3 (but not simultaneously) and person B 
is performing task 2. Given any two output vectors, [task1 person1 start1 
end1] and [task2 person2 start2 end2], I think I want this to be true:

(conde
  [(!= person1 person2)]
  [(<=fd start2 start1) (<=fd end2 start1)]
  [(<=fd end1 start2) (<=fd end1 end2)])

I don't know how to state that this should be true for all combinations of 
the 3 output vectors. Eventually, I will have a variable number of people 
and tasks, so I don't want to just hard-code this conde statement 3 times. 
I've tried using recursion in a defne and I've also tried using doseq, but 
I couldn't get either to work.

This might not even be a good use case for core.logic. I'm just toying with 
some different ideas.

Of course, I can easily change any of the input or output forms if it would 
make this easier.

-- 
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