-
Notifications
You must be signed in to change notification settings - Fork 1
/
pseudocode
76 lines (71 loc) · 2.57 KB
/
pseudocode
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//Define and initialize variables
//Initialize independant variables:
n = N //number of universities
unireputation = [ure[1],..., ure[n]] //randomly distribute reputation to n universities
r = R //number of researchers
resskill = [rs[1],...,rs[r]] //random inital value and upper bound for skill of researchers
//Dependent variables university
unirank = [ur[1],..., ur[n]] // university ranking (unireputation + const*sum(resskill[unires[n]])
unimoney = [um[1],...,um[n]] // university fund (various possibilities: i.e. propto unirank,random,equal..)
unisize = [us[1],...,us[n]] //number of workingplaces (propto unimoney and normed to total number of researchers)
//Dependant variables researchers
resunipos = [rup[1],...,rup[r]] //location of researcher initatialized in a random manner
resuniskill = [rus[1],...,rus[r]] // university dependant skill factor for each researcher (propto unimoney)
resuniwill = [ruw[1,1],...,ruw[1,n];...;ruw[r,1],...,ruw[r,n]]
//will of researchers to go to another university (i.e. random, propto unirank, propto unimoney...)
//Variables system
totskill = sum(resskill) //This value should be optimized
//Simulate
for(1:iterations)
{
//current values:
//calculate dependent variables researcher:
for(1:r)
{
//calculate university dependant skill:
resuniskill[i] = const*unimoney;
if(resskill[i]+resuniskill[i]<upper bound)
{
resuniskill[i]=resskill[i]+resuniskill[i]
}
else
{
resuniskill=upper bound
}
//calculate migration will for each university:
for(j=[i,n])
{
resuniwill[i,j] = ...
}
}
//calculate dependant variables universities:
for(i=1:n)
{
//calculate university rank:
unirank[i]=unireputation+sum(resskill)
//calculate university money:
unimoney[i]= ...
//calculate number of positions at university:
unisize[i]=int(unimoney[i]/n)
}
// migration step:
// 1. Calculate the ranking of the researchers:
resrank[i] = ranking(resskill[i])
// 2. Set variable for number of researchers per universities
uniemploy = [ue[1],...,ue[n]]=[0,...,0] // number of researcher employed
// 3. The best researchers choose first
if(resrank[i]=min(resrank))
{
for(resrank[i]))
{
if(max(resuniprob[i,j]) && uniemp[j]<=us[j])
{
//researchers go to university with space left
resunipos[i]=j
uniemp[j]++
}
}
}
//calculate and plot the total skill:
totskill = sum(resskill)
}