/**
* Matrix
* Author: suhad
* Description:
*/
model Matrix
global {
file Peoplefile4<-file('../includes/41821.csv');
int pos_x;
int pos_y;
// point location;
init
{ matrix data<- matrix(Peoplefile4);
loop i from: 1 to: data.rows -1
{
loop j from: 0 to: data.columns -1
{
create People from: data header:true ;
// with:[pos_x::int(read('pos_x')),pos_y::int(read('pos_y'))];
write "data rows:"+ i +" colums:" + j + " = " + data[j,i];
location.x<-data[i,3];
location.y<-data[i,4];
}
}
}
entities {
species People
{ int pos_x;
int pos_y;
aspect basepeople {draw circle(0.5) color:rgb("green") at:{location.x, location.y};
//location+rnd(300);
}
}
experiment Citymatrix type: gui {output { display disp { species People
aspect: basepeople;
}
}
}
}
}
indeed I want to use location facet as a reference to matrix cells (refer to coordinate locations using matrix cells), how can I do that? , since my code doesn't work