[LRUG] Timetabling library in Ruby

Raul Guiu raulguiu at gmail.com
Thu Aug 11 13:02:42 PDT 2011


Do not overcomplicate it.

Before you save a new appointment you can check if the startdate is
between the start and end date of the existing appointments for that
user.

The academic problem gives you a hole list of appointments and ask you
if any overlaps. It is a bit harder, one way of solving it is by
ordering by start date and look at them in order, you keep the "latest
end date" and keep looking at the appointments, if the start date is
later than the last date that have recorder there is a conflict.

But as I said, if you add the appointments in order you just reject
the ones overlap. SELECT count(*) where start_date <
MY_NEW_APPOINTMENT_START_DATE and end_date >
MY_NEW_APPOINTMENT_END_DATE. (or the equivalent in active record).

Excuse me if my comment is not very helpful or what you expected.


On 11 August 2011 20:23, Riccardo Tacconi <rtacconi at gmail.com> wrote:
> Hi
>
> The StackOverFlow thread Genetic Algorithms are mentioned. May be you can
> find this book useful: http://www.cleveralgorithms.com/
>
> On 11 August 2011 20:06, Luis Correa d'Almeida <luis.ca at gmail.com> wrote:
>>
>> Hello all
>>
>> Wondering if anyone has published/knows of any gems/libraries in Ruby
>> that can compute timetables based on a set of simple restrictions
>> (people can only be in one place at a time, meeting rooms can only
>> hold one meeting at a time, etc...) Classic example would be building
>> the schedule for a university.
>>
>> There are some implementations in Java, but I'd rather not go down
>> that path. In case you are interested, links below.
>>
>> http://www.jboss.org/drools/drools-planner.html
>> http://www.unitime.org/index.php?tab=0
>> http://timefinder.sourceforge.net/
>>
>> Another interesting thread on the subject
>>
>>
>> http://stackoverflow.com/questions/2177836/algorithm-for-creating-a-school-timetable
>>
>>
>> --
>> Luis Corrêa d'Almeida
>> tribe.fm/luis
>> _______________________________________________
>> Chat mailing list
>> Chat at lists.lrug.org
>> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
>
>
> --
> Riccardo Tacconi
> Ruby on Rails and PHP development - System Administration
> VIRTUELOGIC LIMITED
>
> http://github.com/rtacconi
> http://riccardotacconi.blogspot.com
> http://twitter.com/rtacconi
> http://www.linkedin.com/in/riccardotacconi
>
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
>



More information about the Chat mailing list