ATTENTION

This FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices.


flexsim.com

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 05-22-2015
Benjamin Cohen
Guest
 
Posts: n/a
Downloads: 1
Uploads: 0
Default Reporting results

Hi everyone,

I'm struggling with something and I hope you can help me out. I am currently working on a generic user library to be used to re-create truck filling plants.

This is all working out ok, but I have some trouble creating a generic result logging method. For every flowitem that comes through the model, I plan to fill up a row in a global table with relevant data about the flowitem. These datapoints are mostly staytimes, with some chosen paths (outports) and a few flowitem specific labels.

Every datapoint needs to be logged in a different column of the table. Here I run into a problem. I have around 50 datapoints for every flowitem that I want to log, and right now I use global variables to define these columns. The problem is that when I try to build a new model, small changes in the structure of the new model will require me to change many of the column global var values, as well as the commands with which they are written.

This is becoming a rather time-consuming factor, so I'm hoping you could give me some tips on how to organize this better. One optional solution I was thinking about was to write data to a resultcolumn based on the columnheader (something like getcolumnbyheader("LoadingTime")

All advice is very welcome!!

Thanks!
Ben
  #2  
Old 05-22-2015
RalfGruber's Avatar
RalfGruber RalfGruber is offline
FlexSim Software Products
 
Join Date: Jul 2007
Location: Orem, UT, USA
Posts: 195
Downloads: 37
Uploads: 0
Thanks: 518
Thanked 294 Times in 124 Posts
Rep Power: 345
RalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to behold
Default Bundle

Benjamin,

this sounds like a perfect application for bundles instead of global tables. Bundle fields are referenced by their name, not their position in the record and you can also create them on the fly specific to the model's needs.

Plus they are faster than global tables.

Good Luck!

Ralf
FlexSim
The Following 2 Users Say Thank You to RalfGruber For This Useful Post:
Kris Geisberger (05-22-2015)
  #3  
Old 05-23-2015
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

In case you prefer the view for tables (easier to read in FlexSim) you can use Macros (#define) for the column/field names. If you're using a table and have mixed datatypes in a record but clear all records at reset, consider using a rowtemplate node somewhere (eg. variables of the global table - you'll need to do that in the tree) for the initial row (via createcopy() ).

If you did want to use the name of the column then you could also copy the rowtemplate into the table for every new row, and then set the value in the cell by :

setnodenum/str(node(<columnname>,<rownode),<value>)

but if you have the macros set up:

setnodenum/str(rank(<rownode>,<COLUMNMACRO>),<value>)

is probably safer than a string which could have a spelling error.
The Following 3 Users Say Thank You to Jason Lightfoot For This Useful Post:
sagar bolisetti (05-26-2015)
  #4  
Old 05-26-2015
Benjamin Cohen
Guest
 
Posts: n/a
Downloads: 1
Uploads: 0
Default

Thanks all!

I am now using the following commands to find the column number by header:

findmatch(gettablecols("TruckResults"), stringcompare(gettableheader("TruckResults",2,coun t), "Column header")) == 0

And I check before I log the result if the column already exists, if not, I create the column first.

Works allright now!

Tags
column header, global tables, results


Thread Thread Starter Forum Replies Last Post
Results in Experimenter Rachid Kolfin FlexSim HC: Q&A 1 07-12-2013 12:18 PM
Mismatched experimenter results Harry Edwards Q&A 2 04-12-2013 01:00 PM
Experimenter doesn´t show results for transporter Sebastian Hemmann Q&A 1 12-17-2009 06:10 AM


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.