Help with scheduling of tasks
problem&In-Reply-To=mailman.69.1149662727.939.mozart-users@ps.uni-sb.de
Filip Konvička
filip.konvicka.removethisantispamtoken at logis.cz
Thu Jun 8 08:24:47 CEST 2006
Hi Tim,
this is kind of dilemma for me, I see that people on this list are a bit
careful about not spoiling homeworks :-) I'm going to help you a bit though.
Let's use the 3rd possibility :-) (Of course there are many more.) I see
that you constrain a task to a specified time interval (using something
like "TestVal=<:Start.P" etc.). Additionaly, you want to exclude all
tasks from some interval, say, "I". For each task, you could specify -
before you search for a solution - that it occurs either before or after
I. Now there are 2^n combinations, see? So we have 2^n problems, all of
which differ in which tasks must occur before I and which occur after I.
You already know how to constrain a task to a specified interval, so you
should be able to solve these 2^n problems and pick your favorite solution.
The nice thing about Oz is that you can make a non-deterministic choice
inside of a search script. (See the "choice" statement.) This enables
you to solve only one problem instead of the 2^n (in fact, you still
solve 2^n problems, but you can express it using a single script).
Hope this helps,
Filip
> Thanks for the ideas. I did know about these possibilities. What I am
> having trouble with is actually implementing them.
> Could you give me a small example of each? I would really, really,
> appreciate it.
>
>
> Hi,
>
> generally, you have 2 possibilities.
>
> The first is to constrain the task start so that the task can not
> intersect the interval (e.g. using the \=: operator). You know the task
> length, so no problem here.
>
> The other option is even easier: create an artificial fixed task that
> occupies the resource during the outage.
>
> Cheers,
> Filip
>
>> / Hi All,
> />/ />/ I have been studying very hard and have finally created an
> application />/ that will schedule tasks in oz. What is confusing me is
> how to do the />/ following:
> />/ />/ 1. Don't schedule tasks for a certain time frame on a
> particular />/ resource (Either because the resource is down for
> repairs/unavailable or />/ because a task has already been started and
> needs to finish)
> />/ />/ The lines that deal with this in my code are:
> />/ />/ fun {Compile Problem}
> />/ TaskSpec = Problem.tasks
> />/ Dur = {GetDur TaskSpec}
> />/ TestVal = 10
> />/ TestVal2 = 15
> />/ in
> />/ proc {$ Start}
> />/ Start={GetStart TaskSpec}
> />/ {ForAll TaskSpec
> />/ proc {$ T}
> />/ {ForAll {CondSelect T pre nil}
> />/ proc {$ P}
> />/ Start.P + Dur.P =<: Start.{Label T}
> />/ TestVal =<: Start.{Label T}
> />/ TestVal =<: Start.P
> />/ %% Start.P + Dur.P =<: TestVal2
> />/ %% Start.P \=: TestVal
> />/ %% Start.P \=: TestVal2
> />/ end}
> />/ end}
> />/ {Record.forAll Start proc {$ S}
> />/ S={FD.reflect.min S}
> />/ end}
> />/ end
> />/ />/ end
> />/ />/ I can get it to start from a certain point or not schedule after
> a />/ certain point, but I can't figure out how to make the constraints
> such />/ that tasks will be scheduled before a reserved time frame and
> after. />/ Any ideas/help would be greatly appreciated. By the way I
> am very />/ impressed with mozart oz. I am somewhat of a newbie to
> constraint />/ programming but this made it easy to begin./
>
>
More information about the mozart-users
mailing list