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
FAQ Downloads Calendar Search Mark Forums Read

Q&A Using Flexsim and building models

Reply
 
Thread Tools Display Modes
  #1  
Old 11-12-2012
Pablo Concha Pablo Concha is offline
Flexsim User
 
Join Date: Aug 2007
Posts: 104
Downloads: 100
Uploads: 1
Thanks: 103
Thanked 52 Times in 37 Posts
Rep Power: 226
Pablo Concha is just really nicePablo Concha is just really nicePablo Concha is just really nicePablo Concha is just really nice
Default Problem reading/writing tables at end replication

Hi,

i'm having trouble understanding how to reference tables to read/write on end replication trigger on the experimenter.

i'm saving average cycle times of several items on a table, and i want to use another table to calculate at the end of each replication the average of those.

i read the post: http://www.flexsim.com/community/for...ead.php?t=2203 , but i'm not sure i follow... still can't make it work...

regards

Pablo
Reply With Quote
  #2  
Old 11-12-2012
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: 767
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

The quickest way to help you might be with an example model if you have one you can post here.
Reply With Quote
The Following 2 Users Say Thank You to Jason Lightfoot For This Useful Post:
Pablo Concha (11-13-2012), Phil BoBo (11-12-2012)
  #3  
Old 11-13-2012
Pablo Concha Pablo Concha is offline
Flexsim User
 
Join Date: Aug 2007
Posts: 104
Downloads: 100
Uploads: 1
Thanks: 103
Thanked 52 Times in 37 Posts
Rep Power: 226
Pablo Concha is just really nicePablo Concha is just really nicePablo Concha is just really nicePablo Concha is just really nice
Default

Quote:
Originally Posted by Jason Lightfoot View Post
The quickest way to help you might be with an example model if you have one you can post here.
Hi Jason,

i'm ataching a small example.... on the table ctimes i'm counting and calculating the average lenght of stay of each type of item, i want to calculate the average of the counter and the lenght of stay for the number of replications i run on the replication_avg table...

regards

Pablo
Attached Files
File Type: fsm example_ctime.fsm (59.0 KB, 595 views)

Last edited by Jason Lightfoot; 11-10-2014 at 04:22 PM. Reason: restored model
Reply With Quote
  #4  
Old 11-13-2012
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: 767
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

The easiest way is to add a PFM for each of the 'average' cells in each row. Then you get a nice report too.

If you don't want that, you use the replication end trigger to pass the table back and update the target table.

Attached are both cases.
Attached Files
File Type: fsm example_ctime_JL_ctimescollates.fsm (55.2 KB, 596 views)
File Type: fsm example_ctime_JL_PFM.fsm (203.5 KB, 543 views)

Last edited by Jason Lightfoot; 11-10-2014 at 04:19 PM.
Reply With Quote
The Following User Says Thank You to Jason Lightfoot For This Useful Post:
Pablo Concha (11-13-2012)
  #5  
Old 11-13-2012
Pablo Concha Pablo Concha is offline
Flexsim User
 
Join Date: Aug 2007
Posts: 104
Downloads: 100
Uploads: 1
Thanks: 103
Thanked 52 Times in 37 Posts
Rep Power: 226
Pablo Concha is just really nicePablo Concha is just really nicePablo Concha is just really nicePablo Concha is just really nice
Default

Quote:
Originally Posted by Jason Lightfoot View Post
The easiest way is to add a PFM for each of the 'average' cells in each row. Then you get a nice report too.

If you don't want that, you use the replication end trigger to pass the table back and update the target table.

Attached are both cases.
Thanks! , i knew i could use the pfm on the experimenter, but on the real model i have a lot of different types of products, so i wanted a more direct approach like with the tables...

regards

Pablo
Reply With Quote
  #6  
Old 11-15-2012
Pablo Concha Pablo Concha is offline
Flexsim User
 
Join Date: Aug 2007
Posts: 104
Downloads: 100
Uploads: 1
Thanks: 103
Thanked 52 Times in 37 Posts
Rep Power: 226
Pablo Concha is just really nicePablo Concha is just really nicePablo Concha is just really nicePablo Concha is just really nice
Default

I was getting different results from the PFMs on the experimenter and the tables, so i edited the code from the example you send me so i could get only the average of each type of item on each replication...

when comparing this with the data from the PFMs , there is a lot of difference.... i'm doing something wrong?... why is this different??...

i'm attaching the edited example..

regards

Pablo
Attached Files
File Type: fsm example_ctime_JL_ctimescollates_edit.fsm (54.8 KB, 656 views)

Last edited by Jason Lightfoot; 11-10-2014 at 04:20 PM. Reason: Uploaded lost file
Reply With Quote
  #7  
Old 11-15-2012
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: 767
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

I think in my example I added all the samples together to get an overall average which will be different from the PFM.

To match the pfms you just add the average from each replication and divide by the number of replications. I'll post that version in a few mins.
Reply With Quote
  #8  
Old 11-15-2012
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: 767
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

Ah I see now that I've looked at your example.

To compare them you need row 3, column 3 for avg3 PFM (it was row 1 the same as avg 1) and you can also use 'replication' for the column in the end of rep trigger instead of nreps++, to give you a direct comparison for each replication.
Attached Files
File Type: fsm example_ctime_JL2_ctimescollates_edit.fsm (55.6 KB, 598 views)

Last edited by Jason Lightfoot; 11-10-2014 at 04:17 PM.
Reply With Quote
  #9  
Old 11-15-2012
Pablo Concha Pablo Concha is offline
Flexsim User
 
Join Date: Aug 2007
Posts: 104
Downloads: 100
Uploads: 1
Thanks: 103
Thanked 52 Times in 37 Posts
Rep Power: 226
Pablo Concha is just really nicePablo Concha is just really nicePablo Concha is just really nicePablo Concha is just really nice
Default

Quote:
Originally Posted by Jason Lightfoot View Post
I think in my example I added all the samples together to get an overall average which will be different from the PFM.

To match the pfms you just add the average from each replication and divide by the number of replications. I'll post that version in a few mins.
Yes, i noticed that, and i changed also (with something like settablenum(table,row,col,(gettablenum(table,row,c ol)*(nreps-1)+gettablenum(tablecopy,row,col))/nreps);.. that i got from another post of yours)... but still i was getting different results, that's why i tried to save all the results from each replication.... still i was getting different results...

regards

Pablo
Reply With Quote
  #10  
Old 11-15-2012
Pablo Concha Pablo Concha is offline
Flexsim User
 
Join Date: Aug 2007
Posts: 104
Downloads: 100
Uploads: 1
Thanks: 103
Thanked 52 Times in 37 Posts
Rep Power: 226
Pablo Concha is just really nicePablo Concha is just really nicePablo Concha is just really nicePablo Concha is just really nice
Default

Quote:
Originally Posted by Jason Lightfoot View Post
Ah I see now that I've looked at your example.

To compare them you need row 3, column 3 for avg3 PFM (it was row 1 the same as avg 1) and you can also use 'replication' for the column in the end of rep trigger instead of nreps++, to give you a direct comparison for each replication.
still getting different results tho. ?...

they were the same to you?...

regards

Pablo
Reply With Quote
  #11  
Old 11-15-2012
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: 767
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

This model calculates the avg into the table "experiment_avg", while also recording the replication values. You can see they match the PFM statistics.
Attached Files
File Type: fsm example_ctime_JL3_ctimescollates.fsm (67.9 KB, 66 views)
Reply With Quote
  #12  
Old 11-15-2012
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: 767
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

Yes - there's a problem somewhere - the same replication(s) can generate different results, I think there's a bug.
Reply With Quote
  #13  
Old 11-15-2012
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: 767
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

Seems to have stabilized in this version.
Attached Files
File Type: fsm example_ctime_JL3a_ctimescollates.fsm (71.3 KB, 536 views)

Last edited by Jason Lightfoot; 11-10-2014 at 04:16 PM.
Reply With Quote
  #14  
Old 11-15-2012
Pablo Concha Pablo Concha is offline
Flexsim User
 
Join Date: Aug 2007
Posts: 104
Downloads: 100
Uploads: 1
Thanks: 103
Thanked 52 Times in 37 Posts
Rep Power: 226
Pablo Concha is just really nicePablo Concha is just really nicePablo Concha is just really nicePablo Concha is just really nice
Default

Quote:
Originally Posted by Jason Lightfoot View Post
Seems to have stabilized in this version.
i'm still getting differences on this version... attaching results of item 1

regards

Pablo
Attached Thumbnails
Click image for larger version

Name:	example_ctime_JL3a_ctimescollates.jpg
Views:	86
Size:	362.0 KB
ID:	1984  
Reply With Quote
  #15  
Old 11-15-2012
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: 767
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 this one I clear the tables and repaint the view (just to be sure). I've still seen it go wrong though.
Attached Files
File Type: fsm example_ctime_JL3b_ctimescollates.fsm (85.3 KB, 516 views)

Last edited by Jason Lightfoot; 11-10-2014 at 04:15 PM.
Reply With Quote
The Following User Says Thank You to Jason Lightfoot For This Useful Post:
Pablo Concha (11-15-2012)
  #16  
Old 11-15-2012
Pablo Concha Pablo Concha is offline
Flexsim User
 
Join Date: Aug 2007
Posts: 104
Downloads: 100
Uploads: 1
Thanks: 103
Thanked 52 Times in 37 Posts
Rep Power: 226
Pablo Concha is just really nicePablo Concha is just really nicePablo Concha is just really nicePablo Concha is just really nice
Default

Quote:
Originally Posted by Jason Lightfoot View Post
In this one I clear the tables and repaint the view (just to be sure). I've still seen it go wrong though.
i never see one that it's exactly the same... on this last time on the table replication_avg i get two values that repeat through the experiment per row (rep1=rep3=rep5=rep7=rep9 and rep2=rep4=.. etc)..

regards

Pablo
Reply With Quote
  #17  
Old 11-16-2012
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: 767
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

I can't generate the case with different results today - it's looking correct.
Reply With Quote
  #18  
Old 11-23-2012
Pablo Concha Pablo Concha is offline
Flexsim User
 
Join Date: Aug 2007
Posts: 104
Downloads: 100
Uploads: 1
Thanks: 103
Thanked 52 Times in 37 Posts
Rep Power: 226
Pablo Concha is just really nicePablo Concha is just really nicePablo Concha is just really nicePablo Concha is just really nice
Default

Quote:
Originally Posted by Jason Lightfoot View Post
I can't generate the case with different results today - it's looking correct.
Had to add the results as PFMs on the experimenter... i never got the same results.
Reply With Quote
  #19  
Old 11-23-2012
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: 767
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

Thanks for the update - I think it deserves another look then. Will post back here if the problem is found.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Global Table export problem by using end of replication trigger in teh experimenter Peppino Q&A 16 02-22-2013 04:38 AM
reading from excel Chieng Kai Seng Q&A 2 08-08-2011 02:23 AM
Reading Tables from a Database !! Nischith Kashyap Q&A 6 03-03-2011 01:05 AM
What are you reading? Nico Zahn Q&A 4 05-09-2008 11:46 AM


All times are GMT -6. The time now is 07:09 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.