resource ShortPath () import worker const int h = 8 const string[15] hosts[h] = ("137.248.123.142","137.248.123.142","137.248.123.142","137.248.123.142","137.248.123.142","137.248.123.142","137.248.123.142","137.248.123.142"); cap vm vmcap[p] optype workpool(work) op workpool pool [0:p] op chan[p] (int) weightrow weight[n]; int finaldist[n]; int start procedure createworker(int i, weightrow weighti, cap(work) pool[0:p], cap(int) chani, cap vm machine) { create worker(i,weighti,pool,chani) on machine } for [i=1 to h] { locate(i,hosts[i]) } for [i=1 to p] { vmcap[i] = create vm() on ((i-1) mod h)+1 } # Eingabe der Gewichtsmatrix string[20] name; getarg(1, name) file filem = open(name, READ) for [i= 1 to n, j= 1 to n] { read(filem, weight[i][j]) } work startwork startwork.source = 0 startwork.distance = 0 send pool[1](startwork) process monitor { work inwork receive pool[0](inwork) inwork.source = -1; inwork.distance = -1 for [i= 1 to p] { send pool[i](inwork) } } co [i=1 to p] createworker(i,weight[i],pool,chan[i],vmcap[i]) oc for [i=1 to p] { receive chan[i](finaldist[i]); } for [i=1 to p] { destroy vmcap [i] } end ShortPath