unreal results

10 views
Skip to first unread message

Suhad Faisal

unread,
Oct 23, 2014, 9:52:04 AM10/23/14
to
Hello 

please, can I have any comments about my values (source, target) I want to deal  with 2 successive list elements of same list 

     point source  <- localy INDEX i   ;
      point target   <-  localy INDEX i+1 ;
  
       if  (source != target)
             
                distance   <- source distance_to target  ; 
                
     
cheers
Suhad
  

Benoit Gaudou

unread,
Oct 24, 2014, 6:50:46 AM10/24/14
to gama-p...@googlegroups.com
Hi,

the index_of operator returns : 
"the index of the first occurrence of the right operand in the left operand container".

Note that this YOUR model, so we do not have any idea of what means "unrealistic results"...

Benoit

2014-10-23 15:52 GMT+02:00 Suhad Faisal <suha...@gmail.com>:
Hello 

please, can I have any comments about my unreal resulted values (source, target), in spite of the model runs normally ... is the operator "index_of" is mal used ? 

reflex w {
loop i over: alias {
      localy   <- list<float>(self.location);
      towery  <- list<int>(self.tower); 
      aliasy   <- list<int>(self.ali)  ; 
              timery   <- list<int>(self.timy) ;

     point source  <-point(localy index_of i)   ;
     int sourcetime<-timery index_of i;
            
     point target  <-point(localy index_of (i+1)) ;
     int targettime<-timery index_of (i+1)        ;
  
       if  (source!=target)
         {      difftime   <- abs(float(sourcetime-targettime)); 
                distance   <- source distance_to target  ; 
                speedy     <- (distance/difftime)        ;    }  
      
           do  goto target:target on:shape return_path:true speed:speedy; 
                 }   }

cheers
Suhad
  

--
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,
Oct 24, 2014, 8:05:52 AM10/24/14
to gama-p...@googlegroups.com
yes you are right about the model, thank you for reply Benoit

cheers
Suhad
Reply all
Reply to author
Forward
0 new messages