Science topic

Netlogo - Science topic

Explore the latest questions and answers in Netlogo, and find Netlogo experts.
Questions related to Netlogo
  • asked a question related to Netlogo
Question
1 answer
I have a set of positive COVID-19 cases by district in a state. I want to use agent based modelling to make the infected cases move around the state and count the number of infected, number of healthy and number of immune. I have a set of code which the number of population is random and not based on the location. Tried to watch youtube for the tutorial but could not find one which really helps. the code is as below. I want to insert the map of the state, number of population for each district and number of infected in Netlogo.
urtles-own [illness]
to setup
clear-all
reset-ticks
create-turtles 200 [
setxy random-xcor random-ycor
set shape "person"
set color pink
set size 1.0
set illness 0
]
ask n-of starting-number-infected turtles [
set color yellow
set shape "X"
set size 1.0
]
end
to go
tick
move
infect
recover
lose-immunity
end
to move
ask turtles [
rt random 360
fd movement
]
end
to infect
ask turtles [
if color = yellow [
ask turtles in-radius infect-distance [
if random-float 200 < infect-chance [
if color = pink [
set color yellow
set shape "X"
]
]
]
]
]
end
to recover
ask turtles [
if color = yellow [
set illness illness + 1
if illness > infectious-period [
set color white
set shape "circle"
set size 1.0
set illness 0
]
]
]
end
to lose-immunity
ask turtles [
if color = white and waning-immunity < random-float 100 [
set color pink
set shape "person"
]
]
end
Relevant answer
Answer
Hello Sarah Isnan , hope you find this solution worth it.
You can either load a map image (jpg / png) or utilize the Netlogo extension
this will enable you to load shape files (.shp)
extensions [gis]
set city_map_data gis:load-dataset "data/glasgow.shp"
gis:set-world-envelope (gis:envelope-of city_map_data )
gis:draw city_map_data 1
  • asked a question related to Netlogo
Question
3 answers
i want to use agent basic modeling on map
Relevant answer
Answer
Kml or kmz is for google earth file
  • asked a question related to Netlogo
Question
3 answers
Hi there!
I'm starting to model an urban simulation and I'm having a bit of a dilemma regarding what language to use. Have some experience in Netlogo and I'm starting to make a shift towards Repast, GAMA or MESA (geo-mesa), because it is recommended for large scale simulations.
Have been reading papers about which tool to use, but I need someone working on simulations to help me out.
Still, I have questions because:
1- The user base of MESA is scarce and i feel that dealing with issues will be dificult
2- So far i have only seen and read about limited research done in MESA. Specially, dealing with road network integrations. (move an agent along a network)
3- It seems that Netlogo is good for prototype, will not handle big data projects
Thanks in advance, and any pointers to courses or moocs would be great.
Relevant answer
Answer
I have used Anylogic for many years while considering it as a java Agent-baed environment. The java-based modeling framework is more easy and the running performance is also high.
I investigated the urban mobility system. I have developed more than five models with objectives. If you need help, do not hesitate to contact me.
  • asked a question related to Netlogo
Question
3 answers
Suppose we have a system designed to deliver services to customers arriving during weekdays. The arrival process is modeled as a Poisson process with an Arrival rate of λ, also we use agent-based modeling with NetLogo to study the behavior of customers. After multiple Observation and replication of the model, the first 8 hours was selected as the warm-up period and the remaining time as the steady-state. If we consider the average length of stay (ALOS) as the crucial output data, how should we handle the initialization bias in this case?
As a workaround, is removing those data sufficient if we take into account the effects of the warm-up period on the ALOS?
Relevant answer
Answer
Kindly read this work may you can get a strong base about what you are looking for.
If you cannot download it, please let me know. I will try to download it from my side.
Regards
  • asked a question related to Netlogo
Question
6 answers
The aim is to simulate the behavior of agricultural agents in different socio-ecological framework conditions and integrate the simulation with a GIS. I know my way around QGIS and have basic but no significant programming skills yet. I thought of using PYTHON, because I want to learn this language anyhow for GIS scripts, data analysis and statistics. What are the pros/cons of working with MESA, GAMA and SPADE in this regard? NETLOGO is also an option, but would not necessarily be my first choice ...
Thank you for any tips and experiences working in these environments, or for any other possible solutions that might be more feasible for this project!
Relevant answer
Answer
Have you explored the WEAP model?
  • asked a question related to Netlogo
Question
4 answers
I have data from experiments for number of variables as logging, salinity and water use of 150 farmers for 1000 time steps. Farmers' information on land size and distance from water source are available. I want to see that if logging salinity and water use is different considering farmer size and distance from water source as a starting point. I am not sure if cluster analysis will be of any help. I expect to see the graph attached here. Any lead for methods to analyze this type of data set!.
Thanks
Relevant answer
Answer
Very interesting question.
  • asked a question related to Netlogo
Question
6 answers
I want to develop multi agent based control system for fire disaster management.
Relevant answer
Answer
You did not provide sufficient info on your model to be able to understand how complex the implementation is going to be, so I would recommend that you start by exploring both. The free version of AnyLogic is probably easiest as long as you can fit your model withing its limitation. On the other hand the researcher version of AnyLogic is fairly expensive and NetLogo is free.
  • asked a question related to Netlogo
Question
1 answer
Could anyone share sample code of implementing agent-based model of the Emergency department in Netlogo with me?
Relevant answer
Answer
Did you manage to get anything? I am also looking for some help. I have a project on using ABM via Netlogo in ED environments.
  • asked a question related to Netlogo
Question
3 answers
Is there a parallel and distributed version of NetLogo soon expected?
Relevant answer
Answer
Myself and a colleague have published some scripts about this. Here's his first one. http://resources.modelling4all.org/guides/running-experiments-on-a-cluster-of-computers
However, to my knowledge there isn't a parallel distributed version in the works. REPAST HPC is likely your closest best bet if you're looking for that.
  • asked a question related to Netlogo
Question
4 answers
I would to ask about programming language is use in NetLogo? it is Java , c++ or what ?
Relevant answer
Answer
NetLogo installation on computer uses Java.
  • asked a question related to Netlogo
Question
8 answers
I am currently working on using GIS data inside Netlogo using the provided GIS extension. However, i am facing a runtime error saying that
"extension exception: shapefile data <filename> not found"
"error while observer running gis:load-dataset"
I think, the error might be caused by the data directory (where i put the shp data) which is unable to be called by the function.
Thus, i need some insight from other researchers that has experience using this software. million thanks.
Relevant answer
Answer
If you put it in the same folder as your script it should work.
If you want to place it in a separate folder, you can put it in data and define it like this:
set shapefile gis:load-dataset "data/my_shapefile.shp"
Have a look at this example:
  • asked a question related to Netlogo
Question
2 answers
I am using system dynamics as a method for constructing a model of the research-to-impact process in my PhD project.
My university doesn't have the 'usual' system dynamics software such as Vensim, Ithink, or Stella, but does have the system modelling software ExtendSim. I can see it's mainly been used for agent-based modelling, but is it possible to use it for system dynamics modelling too?
If not, does anybody have experience with the free system dynamics software packages NetLogo or Simantics System Dynamics, and what were your experiences with either of these?
Thanks very much,
Alexandra van Beek
Relevant answer
Answer
Thank you!
  • asked a question related to Netlogo
Question
5 answers
In my project of thesis i need simulate the moment of decision in the organizational context. My idea is use Netlogo, but i want see some application in management before.
Relevant answer
Answer
  • asked a question related to Netlogo
Question
3 answers
Hi, I am trying to to use a modification of the erosion model in the netlogo library to simulate erosion on a real landscape. I have already inputted the landscape. I need help with codes that can include vegetation cover (0 to 1) as an environmental parameter and also calculate the erosion rates (intend to display it on a monitor on the interface).
Relevant answer
Answer
Depends a bit on how your data is structured in the model and why the vegetation cover doesn't work so far.
If you already managed to input the landscape (do you mean the digital terrain model with that?) where are your struggles doing the same with the vegetation layer?
Maybe you can explain your problem a bit more specific.
  • asked a question related to Netlogo
Question
4 answers
If you have a variable Xt that changes at every time t, but then is required any function of Xt, Xt-1, Xt-2 .-- and so on until X0 (past values).
Thanks for your opinion.
Relevant answer
Answer
you can achieve this by using lists and initialize it
globals [ x_log ]
set x_log [ ]
with each step (tick) you can extend your list by
set x_log fput attribute x_log
this list now saves all of your attributes.
To perform operations on the list you have a variety of options:
If you only need the latest n values of a list you can create a sub-list:
if length x_log > n [
set x_log_sub sublist x_log 0 n
Use monitors to observe the lists while coding so you won't get any unwanted results.
  • asked a question related to Netlogo
Question
2 answers
Is there any open NetLogo implementation code on tax evasion/compliance other than İcan (2013)?
Relevant answer
Answer
Andrew, thank you for your kind interest. I know Bloomquist's model, we have modified it as follows: http://modelingcommons.org/browse/one_model/4322#model_tabs_browse_info
What I want to do is to compare it with alternative tax evasion models which implemented in NetLogo.
  • asked a question related to Netlogo
Question
2 answers
/** IDEAL ENERGY LANDSCAPE OF HORN CLAUSES **/
/** Bipolar Sigmoid Activation Function **/
How to developed the code by using NetLogo for Bipolar Sigmoid Activation Function ?
Relevant answer
Answer
Thanks
  • asked a question related to Netlogo
Question
3 answers
/** IDEAL ENERGY LANDSCAPE OF HORN CLAUSES **/
/** Bipolar Sigmoid Activation Function **/
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<time.h>
#define NN   10          /** Neurons **/
#define Nc1  2       /** First order **/
#define Nc2  2     /** Second second order **/
#define Nc3  2         /** Third order **/
#define NH   100     /** Number of Hebbian Learning **/
#define RELAX 100      /** Relaxation time **/
#define NT   100     /** Number of trial **/
#define COMBMAX 100    /**Maximum combination for neurons **/
#define TOL   0.001     /** Tolerance value **/
#define TRUE  1
#define FALSE 0
#define NEGBIAS  -0.0
#define NCHCHECK 5
void main()
{
time_tstart,end;
doubledif;
int c3[Nc3][3],c2[Nc2][2],c1[Nc1],i,j,k,l,y,z,n,m,NS[NN],Nbef[NN],iev,ievn,p,comb;
int NI[NN],NF[NN];
floatzM,yM,nrelaxM,nrelaxMM;
float J1[NN],J2[NN][NN],J3[NN][NN][NN];
float Erg1,Erg2,Erg3,E1,E2,E3;
floatdevG,devHD,devHG,devHL;
float ES;
floatEav;
float min;
float h[NN];
floatEavM;
floatvarians,variansR;
floatsp,spR;
float EM,EAM;
floatHamming_Distance,HDG,HDL,HDGlobal,HDLocal;
intchange,nchange,nrelax;
floatnR,NRE,htaf;
time (&start);
FILE *outf;
srand(time(NULL));  
outf=fopen("ss_mine.txt","w");
printf(" hebb logic v 2.1 \n");
printf(" ---------------- \n\n");
printf("Ideal energy landscape of horn clauses \n\n");
fprintf(outf,"Ideal energy landscape of horn clauses \n\n");
printf(" no. of neurons: %d\n no. of learning events: %d\n RELAX time: %d\n no.of trials: %d\n COMBMAX: %d\n ",NN,NH,RELAX,NT,COMBMAX);
fprintf(outf," hebb logic v 2.1 \n");
fprintf(outf," ---------------- \n\n");
fprintf(outf," no. of neurons: %d\n no. of learning events: %d\n RELAX time: %d\n no.of trials: %d\n COMBMAX: %d\n",NN,NH,RELAX,NT,COMBMAX);
printf(" Nc1= %d   Nc2= %d    Nc3= %d  \n",Nc1,Nc2,Nc3);
fprintf(outf," Nc1= %d   Nc2= %d    Nc3= %d  \n",Nc1,Nc2,Nc3);
printf(" TOL = %f \n",TOL);
fprintf(outf," TOL = %f \n",TOL);
/**Initialize average energy **/
EavM=0;         //average synaptic energy for NT     
zM=0;           //average global minima for synaptic
yM=0;           //average local minima for synaptic
ES=-NN*NEGBIAS;           //minimum energy suppose for synaptic
EM=0;           //calculation of varians
EAM=0;
z=0;           //global minima
y=0;           //local minima
Eav=0;         //energy average
HDG=0;
HDL=0;
HDGlobal=0;
HDLocal=0;
nrelaxM=0.0;
nrelaxMM=0.0;
Hamming_Distance=0;
nR=0;
NRE=0;
/** Generating minimum energy suppose to be **/
/** For first order **/
for(i=0;i<Nc1;i++){
     ES+=-0.5;
}
/** For second order **/
for(i=0;i<Nc2;i++){
     ES+=-0.25;
}
/** For third order **/
for(i=0;i<Nc3;i++){
     ES+=-0.125;
}
printf("ES= %f \n\n",ES);
fprintf(outf,"ES= %f \n\n",ES);
/** Loop for random clauses combination **/
for(comb=0;comb<COMBMAX;comb++) {        //combination loop begin
/** generate random clauses **/
/** First order **/
for(i=0;i<Nc1;i++){
stt:
     c1[i]=(int)(((float)rand()/(float)RAND_MAX)*(float)NN); 
     for(j=0;j<i;j++)
     {    if(c1[j]==c1[i])
           gotostt;
     }
}
/** Second order**/
for(i=0;i<Nc2;i++){
stt1:
     c2[i][0]=(int)(((float)rand()/(float)RAND_MAX)*(float)NN);
stt11:
     c2[i][1]=(int)(((float)rand()/(float)RAND_MAX)*(float)NN);
if (c2[i][0]==c2[i][1]) goto stt11;
     for(j=0;j<i;j++) {
           if(c2[j][0]==c2[i][0]&&c2[j][1]==c2[i][1]) goto stt1;
     }
}   
/** Third order **/
for(i=0;i<Nc3;i++){
stt2:
     c3[i][0]=(int)(((float)rand()/(float)RAND_MAX)*(float)NN);
stt21:
     c3[i][1]=(int)(((float)rand()/(float)RAND_MAX)*(float)NN);
if (c3[i][0]==c3[i][1]) goto stt21;
stt22:
     c3[i][2]=(int)(((float)rand()/(float)RAND_MAX)*(float)NN);
if (c3[i][0]==c3[i][2]||c3[i][1]==c3[i][2]) goto stt22;
     for(j=0;j<i;j++) {
           if(c3[j][0]==c3[i][0]&&
           ((c3[j][1]==c3[i][1]&&c3[j][2]==c3[i][2])||
           (c3[j][1]==c3[i][2]&&c3[j][2]==c3[i][1])))     
           goto stt2;
     }
}
/** Initialize synaptic strengths to zero **/
for(i=0;i<NN;i++){
     J1[i]=NEGBIAS;
     for(j=0;j<NN;j++) {
           J2[i][j]=0.0;
           for(k=0;k<NN;k++) {
                J3[i][j][k]=0.0;
           }
     }
}
/** Derive J1 for first order**/
for(i=0;i<Nc1;i++) {
     J1[c1[i]]+=0.5;
 }
/** Derive J2 for second order **/
for(i=0;i<Nc2;i++){
     J2[c2[i][0]][c2[i][1]]+=0.25;
     J2[c2[i][1]][c2[i][0]]+=0.25;
     J1[c2[i][1]]+=-0.25;
     J1[c2[i][0]]+=0.25;
}
/** Derive J3 for third order **/
for(i=0;i<Nc3;i++) {
     J3[c3[i][0]][c3[i][1]][c3[i][2]]+=0.0625;
     J3[c3[i][0]][c3[i][2]][c3[i][1]]+=0.0625;
     J3[c3[i][1]][c3[i][2]][c3[i][0]]+=0.0625;
     J3[c3[i][2]][c3[i][1]][c3[i][0]]+=0.0625;
     J3[c3[i][2]][c3[i][0]][c3[i][1]]+=0.0625;
     J3[c3[i][1]][c3[i][0]][c3[i][2]]+=0.0625;
     J2[c3[i][1]][c3[i][0]]+=0.125;
     J2[c3[i][0]][c3[i][1]]+=0.125;
     J2[c3[i][1]][c3[i][2]]+=-0.125;
     J2[c3[i][2]][c3[i][1]]+=-0.125;
     J2[c3[i][0]][c3[i][2]]+=0.125;
     J2[c3[i][2]][c3[i][0]]+=0.125;
     J1[c3[i][2]]+=-0.125;
     J1[c3[i][0]]+=0.125;
     J1[c3[i][1]]+=-0.125;
}
/** Loop to generate random numbers**/
ievn=0;                         //number of events satisfy
for(iev=0;iev<NH;iev++)   {      //number of events  satisfy and not satisfy
sth:
ievn++;
for(j=0;j<NN;j++){
if((float)rand()<(float)RAND_MAX/2.0)
          NS[j]=-1;       
     else NS[j]=+1;            
}
/** Checking clauses satisfaction by events **/
/** For first order **/
     for(k=0;k<Nc1;k++){
     if(NS[c1[k]]==-1) gotosth;
       }
/** For Second Order **/
for(k=0;k<Nc2;k++){
     if(NS[c2[k][0]]==-1 && NS[c2[k][1]]==+1)
          gotosth;
}
/** For Third Order **/
for(k=0;k<Nc3;k++){
     if(NS[c3[k][0]]==-1 && NS[c3[k][1]]==+1 && NS[c3[k][2]]==+1)
           gotosth;
}
}                                 //end of learning process
/**Looping number of trial **/
           for(p=0;p<NT;p++){              //number of trial loop begin
/** Initialize random starting point **/
           for(m=0;m<NN;m++){
if((float)rand()<(float)RAND_MAX/2.0)
          NS[m]=-1;       
     else NS[m]=+1;
NI[m]=NS[m];    //Initial State
           }   
/** Looping energy relaxation **/
nrelax=0;
nchange=0;
do {            
/** Calculating h **/
        change=FALSE;
           for(i=0;i<NN;i++){          //sub major loop   
                j=((float)NN)*(((float)rand()/(float)RAND_MAX));
           h[j]=0;
           h[j]+=J1[j];
           for(k=0;k<NN;k++){
                h[j]+=J2[j][k]*NS[k];
                for(l=0;l<NN;l++){
                     h[j]+=J3[j][k][l]*NS[k]*NS[l];
                }
           }              
/** Bipolar sigmoid activation function **/
                htaf=(1-exp(-h[j]))/(1+exp(-h[j]));
                Nbef[j]=NS[j];
           if(htaf>=0)
                NS[j]=+1;
           else
                NS[j]=-1;
           if(NS[j]!=Nbef[j])
                change=TRUE;
                }                             //sub major loop end
           if(change==TRUE)
                nchange=0;
           elsenchange+=1;
           nrelax+=1;
   } while (nchange<NCHCHECK);                                     
/** Calculating Final State **/
for(m=0;m<NN;m++) {
     NF[m]=NS[m];                                   //Final State
   }
/** Energy Calculation **/
Erg1=0;Erg2=0;Erg3=0;
E1=0;E2=0;E3=0;
for(l=0;l<NN;l++){
     for(j=0;j<NN;j++){
           for(k=0;k<NN;k++){
E1+=J3[l][j][k]*NS[l]*NS[j]*NS[k];
Erg1=-E1/3;
           }
     }
}
     for(l=0;l<NN;l++){
           for(j=0;j<NN;j++){
E2+=J2[l][j]*NS[l]*NS[j];
Erg2=-E2/2;
Erg2+=Erg1;
           }
     }
     for(l=0;l<NN;l++){
     E3+=J1[l]*NS[l];
Erg3=-E3;
Erg3+=Erg2;
     }
/** Calculating global and local minima  **/
     if(fabs(ES-Erg3)<=TOL) {
    z+=1;
for(m=0;m<NN;m++)
    HDG+=0.5*(1-NI[m]*NF[m]);
     }
     if(fabs(ES-Erg3)>TOL){
     y+=1;
     for(m=0;m<NN;m++)
     HDL+=0.5*(1-NI[m]*NF[m]);
     }
/** Calculating EM **/
EM+=Erg3*Erg3;
/**Calculating average energy **/
Eav+=Erg3/(float)NT;
/** Calculating nR **/
nR+=nrelax*nrelax;
/** Calculating relaxation **/
nrelaxM+=(nrelax-NCHCHECK)/((float)NT);
           }                                          // number of trials
     }                                              //Loop for number of combination
/**Calculating average energy for all the combination **/
EavM+=Eav/(float)COMBMAX;                       //average energy for synaptic
zM+=(float)z/((float)NT*(float)COMBMAX);             //global minima for synaptic
yM+=(float)y/((float)NT*(float)COMBMAX);             //local minima for synaptic
EAM+=EM/((float)NT*(float)COMBMAX);                  //varians calculation
nrelaxMM+=nrelaxM/(float)COMBMAX;
HDGlobal+=HDG/((float)NT*(float)COMBMAX * z);
HDLocal+=HDL/((float)NT*(float)COMBMAX * y);
NRE+=nR/((float)NT*(float)COMBMAX);
/** Calculating varians **/
varians=(float)EAM-pow(EavM,2);
/** Standard DEviation **/
sp=sqrt(varians);
/** Calculating varians for relax**/
variansR=(float)NRE-pow(nrelaxMM,2);
/** Standard DEviation for relax**/
spR=sqrt(variansR);
/** Calculating Hamming Distance **/
if(y==0)
Hamming_Distance+=HDGlobal;
else
Hamming_Distance+=HDGlobal+HDLocal;
/** Deviation for Hamming Distance**/
devHD=sqrt(Hamming_Distance-(Hamming_Distance*Hamming_Distance));
/** Deviation for global **/
devG=sqrt(zM-(zM*zM));
/** Deviation for HDG **/
devHG=sqrt(HDGlobal-(HDGlobal*HDGlobal));
/** Deviation for HDL **/
devHL=sqrt(HDLocal-(HDLocal*HDLocal));
/**Printing out clauses (one set only)**/
printf("\n Clauses:\n\n"); 
fprintf(outf,"\n Clauses:\n\n");    
for(i=0;i<Nc1;i++){                            //First order **/
printf("c1[%d] : %d <- .\n",i,c1[i]);
fprintf(outf,"c1[%d] : %d <-.\n",i,c1[i]);
}
printf("\n");  
fprintf(outf,"\n");
for(i=0;i<Nc2;i++){                             //Second order
     printf("c2[%d] : %d <- %d .\n",i,c2[i][0],c2[i][1]);
fprintf(outf,"c2[%d] : %d <- %d .\n",i,c2[i][0],c2[i][1]);
}
printf("\n");  
fprintf(outf,"\n");
for(i=0;i<Nc3;i++){                              //Third order
printf("c3[%d] : %d <- %d, %d .\n",i,c3[i][0],c3[i][1],c3[i][2]);
fprintf(outf,"c3[%d] : %d <- %d, %d .\n",i,c3[i][0],c3[i][1],c3[i][2]);
}
printf("\n");  
fprintf(outf,"\n");
/**For synaptic weight **/
printf("For synaptic weight\n\n");
fprintf(outf,"For synaptic weight\n\n");
printf
("\n zMHamming_Distance       \n");
printf
("   %f                %f \n",zM,Hamming_Distance); 
fprintf
(outf,"\n zMHamming_Distance       \n");
fprintf
(outf," %f    %f \n",zM,Hamming_Distance); 
/** printf("z= % d \n",z);
fprintf(outf,"z= % d \n",z);
printf("y= % d \n",y);
fprintf(outf,"y= % d \n",y);
printf("zM= % f \n",zM);
fprintf(outf,"zM= % f \n",zM);
printf("yM= % f  \n",yM);
fprintf(outf,"yM= % f  \n",yM);
printf("devG= % f \n",devG);
fprintf(outf,"devG= % f \n",devG);
printf("EavM= %f \n",EavM);    
fprintf(outf,"EavM= %f \n",EavM);   
printf("devEnergy= % f \n\n",sp);
fprintf(outf,"devEnergy= % f \n\n",sp);
printf("Hamming_Distance= %f  \n",Hamming_Distance);
fprintf(outf,"Hamming_Distance= %f  \n",Hamming_Distance);
printf("devHD= % f \n\n",devHD);
fprintf(outf,"devHD= % f \n\n",devHD);
printf("Hamming Distance for Global= %f \n",HDGlobal);
fprintf(outf,"Hamming Distance for Global= %f \n",HDGlobal);
printf("devHG= % f \n\n",devHG);
fprintf(outf,"devHD= % f \n\n",devHG);
printf("Hamming Distance for Local= %f \n",HDLocal);
fprintf(outf,"Hamming Distance for Local= %f \n",HDLocal);
printf("devHL= % f \n\n",devHL);
fprintf(outf,"devHL= % f \n\n",devHL);
printf("n relax= % f \n",nrelaxMM);
fprintf(outf,"n relax= % f \n",nrelaxMM);
printf("devRelax= % f \n",spR);
fprintf(outf,"devRelax= % f \n",spR); **/
     time (&end);
     dif = difftime (end,start);
     printf ("\nIt took %.2lf seconds to run the program.\n", dif );
     fprintf(outf,"\nIt took %.2lf seconds to run the program.\n", dif );
     fclose(outf);
}
Relevant answer
Answer
I think,
Since extensions are written in Java and Java allows interaction with libraries/code written in other languages through the Java Native Interface, you will indeed need to write an extension (there may be other options that I don't know about).
Optionally, Swig might be helpful here: http://www.swig.org/, for a tutorial, see http://www.swig.org/tutorial.html
Moreover, you can do this!
It is possible to call applications or scripts written in other languages using the Shell extension created by Eric Russell (see Extensions at http://ccl.northwestern.edu/netlogo/resources.shtml).
The main commands are:
# shell:exec <command> (shell:exec <command> <param> ...) => execute command synchronously and report a string of the results it prints to stdout
# shell:fork <command> (shell:fork <command> <param> ...) => execute command asynchronously and discard the results
You can do something like (in Windows)
show (shell:exec "cmd" "/c" (word C++App.exe " " C++App_Param " " C++App_Input))
I noticed that I have to specify the complete path to the application and input file(s) when I create the string passed to shell: exec.
I tested this with Python code, and it worked fine.
(my Friends suggested them)
Good Luck
  • asked a question related to Netlogo
Question
4 answers
I am working on applying artificial intelligence to VANETS. I have already done some simulations using 4x4 and 6x6 road topologies. I am now trying to integrate real maps into the simulation, can anyone who is familiar with NetLogo simulation show me how this can be done?
Relevant answer
Answer
 @Jorge Ramirez,Can you please share some simple example of how to convert the GIS files into X,Y,Z coordinates and read them into netlogo and the conversion script  as well? Thanks in Advance  
  • asked a question related to Netlogo
Question
1 answer
How to develop the code by using NetLogo for Activation Function?
Relevant answer
Answer
The product between a 3D tensor and a 1D vector is a 2D matrix in the same way in which the product between a 2D matrix and 1D vector is a 1D vector.
In the Socher paper, the role of the tensor is really just to model a fully-parameterized function f(Rn×Rn)→Rmf(Rn×Rn)→Rm, so it gives us a way of combining two vectors to give you a third vector of a different size.
I think the Neural Network metaphor is less applicable to this particular architecture. Just think of the whole equation you wrote as a function with two nn-dimensional vectors as input, a scalar as output, and number parameters uTR,W[1:k]R,VR,bRuRT,WR[1:k],VR,bR, and fit those parameters via gradient descent (taking the function derivative), as you would in linear regression.
  • asked a question related to Netlogo
Question
5 answers
I wanted to used Netlogo but I am afraid it wouldn't scale well. I need to be able to implement mathematical formula for decision making and learning and also play with distributions. What is your experience with agent based modeling of financial markets?
Relevant answer
Answer
Let me suggest you FLAME.  It has been used in economics modelling like:
Mike Holcombe, Simon Coakley, Mariam Kiran, Shawn Chin, Chris Greenough, David Worth, Silvano Cincotti, M. Raberto, Andrea Teglio, , Christophe Deissenberg, Sander van der Hoog, Herbert Dawid, Simon Gemkow, Philipp Harting, Michael Neugart, Large-scale Modelling of Economic Systems, Complex Systems
For more info you can visit:
  • asked a question related to Netlogo
Question
3 answers
I am interested in computing local moran's I in Netlogo to identify significant clustering. While I am able to export my data into another software to compute this, there is no software I am aware of to compute moran's I that will take into account the world wrapping. 
Relevant answer
  • asked a question related to Netlogo
Question
15 answers
I want to use a ABS tool for learning faster, at the beginning, about Agent-based modelling, but I am not sure which is better. Which is the most used by you? Also, I have been programming in python, nevertheless, I think I could improve more by doing models with those tools.
Relevant answer
Answer
I have used NetLogo in the class room and RePast as a rapid prototyping tool to develop larger and more complicated systems. I agree what has been said before, with some caveats: NetLogo and RePast are both, at their core, synchronous systems. That means that agent A does something, then agent B does something and so on without true parallelism. There are primitives in NetLogo for pseudo-asynchronous execution, but they are not powerful enough to model a truly asynchronous system.
What does that mean in practice? It means that whatever multi-agent system you build, you need to be aware of the fact that it will have significantly different execution semantics than you would find in a "real" distributed system. If you at one point want to make the move from your own development machine on to a multi-machine setup you will necessarily run into problems. For the same reason, you also must be very careful with the evaluation results you get from systems such as RePast.
There are a number of other things to consider, e.g., that neither NetLogo nor RePast have a messaging system. The way agents are programmed in these environments is also rather cringe-worthy from a software engineering perspective. But that is OK, because the purpose of these tools is to get results quickly and have a flat learning curve.
Where does that leave us? I suggest you make your first steps with NetLogo as suggested above and try to build asynchronous systems. Then quickly move on to a "real" MAS environment. JADE is always a good bet, but I also suggest to take a look at JADEX which has a very nice annotation-based programming interface.
  • asked a question related to Netlogo
Question
7 answers
I have played a bit with netlogo over the holidays and produced a very simple model which demonstrates a difference between crowdsourcing and crowd tasking. All it does is to implement two types of agents which can report on "issues":
  • Type 1 ("reporters") walks randomly and spontaneously reports "issues" in their neighbourhood.
  • Type 2 ("observers") can be talked to confirm the findings.
The model nicely demonstrates the obvious: taskable volunteers are much better at confirming the findings than the random walkers.
I see plenty of possibilities for improving this model, but I am not sure what to go for first. Motivation? Different task types? More intelligent tasking mechanism? GIS? Service API?
In your opinion, what is/are the most important features which this crowdsourcing/ crowd tasking model should implement?
Relevant answer
Answer
Dear Denis,
I've never used NetLogo, but I find the idea to apply it to this domain very interesting. I have approached the differences between crowdsourcing and crowdtasking from the perspective of volunteers' involvement in disaster management efforts, trying to understand different forms of contribution and outcomes. Perhaps this paper can offer a few suggestions on different roles and levels of involvement: http://link.springer.com/chapter/10.1007/978-3-662-45960-7_19
Cheers,
Marta
  • asked a question related to Netlogo
Question
3 answers
I have done some works with NetLogo simulation tool in artificial intelligence and I will be glad to have a discussion with anyone who is familiar with it. I want to integrate real maps into the simulation environment and will like to discuss how to go about it.
Relevant answer
Answer
Netlogo is just a simulation environment for distributed systems. The intelligent part is up to you. I mean, that there is no AI technique implemented that you can include as a library/extension. If you need a neuronal network, a heuristic search strategy, a pattern recognition model, etc. you have to implement it or search for the code of some one that have implemented it already.
Therefore, it will depend on what you want to do. If I can help you, just ask ;-)
  • asked a question related to Netlogo
Question
1 answer
Using evolutionary algorithms
Relevant answer
Answer
Hi.
I am a bit skeptical if NetLogo is the right tool for the job. Maybe you want to have a look at ECJ http://cs.gmu.edu/~eclab/projects/ecj/ or Framsticks http://www.framsticks.com/