mix of data

24 views
Skip to first unread message

Suhad Faisal

unread,
Sep 24, 2014, 1:50:50 PM9/24/14
to gama-p...@googlegroups.com
Hello 

I have table of  mixed data (colums of integers & column of timestamp)
I read it as matrix but the timestamp appears as zero "wrong data" 

the  timestamp compound of this format  "day/month/year  hour : miute: second"

so how to use the part of  "day : hour: miute:second"

then to use separately the part of "hour: miute:second" in computing speed of agents 

any techniques ! 

thanks in advance

cheers
suhad

Patrick Taillandier

unread,
Sep 24, 2014, 1:52:17 PM9/24/14
to gama-p...@googlegroups.com
Hi,

Can you send us a sample of your data and the part of your model that concerns the loading of the data.

Cheers,

Patrick

--
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,
Sep 24, 2014, 2:31:33 PM9/24/14
to gama-p...@googlegroups.com
Hello dear Patrick


well I have several prototypes for modeling same idea, so if you found silly things please, concerned it as trials to make my model 

However, the models would be arranged in Chronological sequence as in title of each.

if I'm understanding correct , I found that the cause of my unreal agent trajectory is the speed value is not compatible with the model simulation cycle , so I need to compute the speed from the distance divided by time to find speed value, then to draw & simulate agent trajectory.


many thanks to your collaboration 


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/Pv6DJQ4VzLc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gama-platfor...@googlegroups.com.
alias2191258.csv
alias2191258andjour4.csv
alias2191258andjour4H.csv
alias2191258Date.csv
VoronoiVoronoi.shp
ProtoType18.9.gaml
ProtoType19.9.gaml
ProtoType23.9.gaml

Patrick Taillandier

unread,
Sep 24, 2014, 3:27:35 PM9/24/14
to gama-p...@googlegroups.com
Hi,

Didn't check all the models, but just the loading the cdv data. 
In your data, for the date and hour, you do not have the same separator as for the other data (";"), so you have to split the data by yourself using the split_with operator.

Thus, first do not try to cast your CSV file as int matrix but just as string matrix:

file      aliasmatrix     <- csv_file('../includes/alias2191258Date.csv',';');

matrix<string> init_data <- matrix<string>(aliasmatrix);

    

Then, you can just write something like:

loop i from: 1 to: init_data.rows-1 {

    write "  ";

    loop j from: 0 to: init_data.columns-1 {

         if (j = 4) {

          list<string> vals <- init_data [j,i] split_with " ";

          list<string> date <- vals[0] split_with "/";

          list<string> time_strs <- vals[1] split_with ":";

          write "year: " + date[2];

          write "month: " + date[1];

          write "day: " + date[0];

          write "hour: " + time_strs[0];

          write "minute: " + time_strs[1];

          } else {

          write "LCSV " + i +"  "init_data [j,i] ; 

          }

      }

}

           

Cheers,

Patrick

Suhad Faisal

unread,
Sep 24, 2014, 3:42:39 PM9/24/14
to gama-p...@googlegroups.com
thank you dear Patrick for help & support , sorry for sending multiple models , but I do that cause want to indicate that I may be lost among many trials 

best regards 

cheers
Suhad



Reply all
Reply to author
Forward
0 new messages