ATTENTIONThis 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 |
#1
|
|||
|
|||
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 |
#2
|
|||
|
|||
The quickest way to help you might be with an example model if you have one you can post here.
|
The Following 2 Users Say Thank You to Jason Lightfoot For This Useful Post: | ||
Phil BoBo (11-12-2012) |
#3
|
|||
|
|||
Quote:
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 Last edited by Jason Lightfoot; 11-10-2014 at 04:22 PM. Reason: restored model |
#4
|
|||
|
|||
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. Last edited by Jason Lightfoot; 11-10-2014 at 04:19 PM. |
The Following User Says Thank You to Jason Lightfoot For This Useful Post: | ||
Pablo Concha (11-13-2012) |
#5
|
|||
|
|||
Quote:
regards Pablo |
#6
|
|||
|
|||
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 Last edited by Jason Lightfoot; 11-10-2014 at 04:20 PM. Reason: Uploaded lost file |
#7
|
|||
|
|||
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. |
#8
|
|||
|
|||
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. Last edited by Jason Lightfoot; 11-10-2014 at 04:17 PM. |
#9
|
|||
|
|||
Quote:
regards Pablo |
#10
|
|||
|
|||
Quote:
they were the same to you?... regards Pablo |
#11
|
|||
|
|||
This model calculates the avg into the table "experiment_avg", while also recording the replication values. You can see they match the PFM statistics.
|
#14
|
|||
|
|||
i'm still getting differences on this version... attaching results of item 1
regards Pablo |
#15
|
|||
|
|||
In this one I clear the tables and repaint the view (just to be sure). I've still seen it go wrong though.
Last edited by Jason Lightfoot; 11-10-2014 at 04:15 PM. |
The Following User Says Thank You to Jason Lightfoot For This Useful Post: | ||
Pablo Concha (11-15-2012) |
#16
|
|||
|
|||
Quote:
regards Pablo |
#18
|
|||
|
|||
Had to add the results as PFMs on the experimenter... i never got the same results.
|
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 |