Skip to first unread message

Suhad Faisal

unread,
Mar 5, 2015, 6:33:19 PM3/5/15
to gama-p...@googlegroups.com
Hello 

I divide one species population into multi populations and I want to display each population of them in some Gama cycle/s (it will be like to display these populations in specific synchronization) according to controled cycles like 

population A in cycle 1 
population B in cycle 2 


can show me the way to do it ! 

thanks in advance 

cheers
Suhad

Benoit Gaudou

unread,
Mar 6, 2015, 3:04:05 AM3/6/15
to gama-p...@googlegroups.com
Hi,

The way agents are displays is defined in the aspect block of the species (with draw statements).
If nothing is drawn, agents will not be displayed.
So you could add conditionals (if) in the aspect to draw them according to conditions  on cycle : 
if (condition on cycle is fulfilled) {
  draw .... // the way it should be drawn
} else { 
// nothing : to not display it
}

Benoit


--
You received this message because you are subscribed to the Google Groups "GAMA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platfor...@googlegroups.com.
To post to this group, send email to gama-p...@googlegroups.com.
Visit this group at http://groups.google.com/group/gama-platform.
For more options, visit https://groups.google.com/d/optout.

Suhad Faisal

unread,
Mar 6, 2015, 3:22:25 AM3/6/15
to gama-p...@googlegroups.com
thanks Benoit 

I try it as follows but , the shape disappear it display nothing now 

aspect base1  {  
            if houry=1 and cycle=1 { 
               draw shape color: color1 ;}
                 
                 if houry=2 and cycle=2 { 
                draw shape color: color1-100 ;}
                
                if houry=3  and cycle=3 { 
                draw shape color: color1-50 ;}
                
                if houry=4 and cycle=4 { 
                draw shape color: color1-150 ;}
                
                              }        }            
            
experiment Densities type:gui  { output {    
display coloring {
            species towers     aspect:base1  ; } } 

cheers
Suhad
                          

--
You received this message because you are subscribed to a topic in the Google Groups "GAMA" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gama-platform/cpofY_SGCrg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gama-platfor...@googlegroups.com.

Benoit Gaudou

unread,
Mar 6, 2015, 3:41:00 AM3/6/15
to gama-p...@googlegroups.com
Notice that the first cycle (when you launch the simulation) is set to 0.
Benoit

Suhad Faisal

unread,
Mar 6, 2015, 4:36:22 AM3/6/15
to gama-p...@googlegroups.com
thank you Benoit 
I will try and keep in touch 

cheers
Suhad

Suhad Faisal

unread,
Mar 6, 2015, 9:03:54 AM3/6/15
to gama-p...@googlegroups.com
Hello Benoit 

please can you advice me to implement my idea correctly , colors still not work well (I have just black and white colors), 
in spite of the dens is work perfect and I mapped the colors to be in the correct range ... but I need your comments 


many thanks in advance 
cheers
Suhad

global 
{        file            data1     <-file('../includes/Disday10actp1.shp');
         file            data2     <-file('../includes/Disday10actp2.shp');
         file            vor        <-file('../includes/VoronoiVoronoi.shp');
        geometry    shape    <-envelope(vor)                          ;
init {
create people1 from:data1 with:[user::int(read('alias')), towery::int(read('mat_id')),  
                                              location.x::int(read('pos_x')),location.y::int(read('pos_y'))];
create people2 from:data2 with:[user::int(read('alias')),towery::int(read('mat_id')),
                                      location.x::int(read('pos_x')),location.y::int(read('pos_y'))];                        
                   }                     }  
entities
 {
species people1 { int  towerid;    int user; int towery; }
species people2 { int  towerid;    int user; int towery; }

species towers {   int  towerid;  int cycle<-0;
                   int dens1<-0 ;float base1  update: float(dens1); rgb  color1    update: rgb((dens1-255/255),0,0); 
                   int dens2<-0 ;float base2  update: float(dens2); rgb  color2    update: rgb((dens2-255/255),0,0);

reflex density1 when:cycle=0  { 
         ask towers {  dens1 <- length( agents_inside(myself) of_species people1 );    }
            write "dens   " + dens1 + "    at tower   " + towerid +"Cycle0" ;  }
            aspect base1  {   draw shape color: color1 ;} 

reflex density2 when:cycle=1 { 
         ask towers {  dens2 <- length( agents_inside(myself) of_species people2 );     }
            write "dens   " + dens2 + "    at tower   " + towerid+"Cycle1" ;   }
            aspect base2  {   draw shape color: color2 ;} 

reflex cycling{cycle<-cycle+1;}

            }                 } 
experiment Densities type:gui  { 
output {     display Slice1 { species towers     aspect:base1  ;
    species towers     aspect:base2  ; }        }    }



To unsubscribe from this group and stop receiving emails from it, send an email to gama-platform+unsubscribe@googlegroups.com.

To post to this group, send email to gama-p...@googlegroups.com.
Visit this group at http://groups.google.com/group/gama-platform.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "GAMA" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gama-platform/cpofY_SGCrg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gama-platform+unsubscribe@googlegroups.com.

To post to this group, send email to gama-p...@googlegroups.com.
Visit this group at http://groups.google.com/group/gama-platform.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "GAMA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platform+unsubscribe@googlegroups.com.

To post to this group, send email to gama-p...@googlegroups.com.
Visit this group at http://groups.google.com/group/gama-platform.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "GAMA" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gama-platform/cpofY_SGCrg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gama-platform+unsubscribe@googlegroups.com.

Benoit Gaudou

unread,
Mar 7, 2015, 5:06:26 AM3/7/15
to gama-p...@googlegroups.com
Hi,

I am curious to know how you can say that "the dens is work perfect ", when you never compute it ... because you never create any towers agent in this model.
I guess it is the reason why nothing is displayed in your model.

Benoit

2015-03-06 15:03 GMT+01:00 Suhad Faisal <suha...@gmail.com>:
Hello Benoit 

please can you advice me to implement my idea correctly , colors still not work well, in spite of the dens is work perfect and I mapped the colors to be in the correct range ... but I need your comments 
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platfor...@googlegroups.com.

To post to this group, send email to gama-p...@googlegroups.com.
Visit this group at http://groups.google.com/group/gama-platform.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "GAMA" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gama-platform/cpofY_SGCrg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gama-platfor...@googlegroups.com.

To post to this group, send email to gama-p...@googlegroups.com.
Visit this group at http://groups.google.com/group/gama-platform.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "GAMA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platfor...@googlegroups.com.

To post to this group, send email to gama-p...@googlegroups.com.
Visit this group at http://groups.google.com/group/gama-platform.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "GAMA" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gama-platform/cpofY_SGCrg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gama-platfor...@googlegroups.com.

To post to this group, send email to gama-p...@googlegroups.com.
Visit this group at http://groups.google.com/group/gama-platform.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "GAMA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platfor...@googlegroups.com.

Suhad Faisal

unread,
Mar 7, 2015, 5:40:42 AM3/7/15
to gama-p...@googlegroups.com
Hello Benoit 

many thanks to your collaboration and replies 

yes dear I create towers but (its lost in the copy/paste) of the model into the Email message, but the model which I sent it to you has the   towers creation, this is the reason why I sent the model to give always the accurate code for you without any lack of them.

I appreciate your valuable help , your replies really helpfull.


best regards

cheers
Suhad
Reply all
Reply to author
Forward
0 new messages