Oz and Mozart Users Mailing List

Re: Re: User-Defined Distributors


From: Adriano Volpones (adriano.volpones@arscomputandi.com)
Date: Mon May 06 2002 - 16:17:22 CEST


Sorry for the partial information.

the real problem is how can I add constraints after a "choosing point" where the informations needed are determined by the choose.

I've already solved the problem putting the new contraints outside the binary choice-statements but the question remains so I'll try to explain:

I need to add one task at time to alternative machines so that the next task could aggregate to the nearest task on the alternative machines;
but the last task on machines is only known after the assignment and the serialization on that and after the constraining on job.

So the pseudo-code could be:
    
    Constrain_jobs Jobs Tasks
    Distribute_machines Tasks Machines
        ForAll Machines constrain_machine Machine Tasks
                        
    
the real code is:

   %
   %task(id:Id s:Start e:End d:Dur machidx:Midx toolidx:Toolidx setup:Setup aggr:[A1] ...)
   %machine(id:Id idx:Midx calnd:Calnd ...)
   %
   proc{MachinesDistributorAggrPrim ToBeScheduled AllTasks Machines}
      {Space.waitStable}
      local
      Ts={Filter ToBeScheduled fun{$ T} {FD.reflect.size T.machidx}>1 end}
   in
      case Ts of nil then skip %nothing to do
      [] T|Tr then M = {GetNextMachineIndexAggr T AllTasks} %sort by start on machines get nearest for aggr:
      in
         choice T.machidx=M
            {Durs.constraintDurations [T] Machines} %constr.durations
blocking >>>{Calnd.constraintMachinesDistr Machines [{Nth Machines T.machidx}] AllTasks nil}%constr.machines
            T.s = {FD.reflect.min T.s} %assign starts
            {MachinesDistributorAggrPrim Tr AllTasks Machines}
         [] T.machidx \=: M
            {MachinesDistributorAggrPrim Ts AllTasks Machines}
         end
     end
  end

it blocks only when the time horizon (max in T.s and T.e) is too low to accomodate in the first trial all the tasks.

Cheers,

        Adriano

-
Please send submissions to users@mozart-oz.org
and administriva mail to users-request@mozart-oz.org.
The Mozart Oz web site is at http://www.mozart-oz.org/.



This archive was generated by hypermail 2b29.