了解minzinc

Understanding minzinc

我正在尝试解决我的问题,我在这里使用 Hakan 的代码作为示例 http://hakank.org/minizinc/scheduling_with_multiple_workers.mzn

我不知道这部分代码的确切含​​义,其中 machine[t]=m。谁能给我解释一下这部分?

forall(m in 1..num_machines) (
     % check the memory of the times when a task is run on the machine
     forall(tt in 1..max_time) (
        machine_used_ram[m,tt] = sum([memory[t]*(machine[t]=m)*(tt in start_time[t]..end_time[t]) | t in 1..num_tasks])

(machine[t]=m)是布尔表达式转换为1,如果machine[t]等于m。否则就是0.

因此,(machine[t]=m)*(tt in start_time[t]..end_time[t]) 正在选择所有要求和的内存值,这些内存值属于机器和外部 forall 循环的时间。