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-15-2008
Tom David's Avatar
Tom David Tom David is offline
Flexsim User
 
Join Date: Aug 2007
Location: Schwaebisch Gmuend, Germany
Posts: 430
Downloads: 157
Uploads: 47
Thanks: 486
Thanked 450 Times in 233 Posts
Rep Power: 520
Tom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant future
Default profileevents() and order of event nodes under project/exec/events

I just wonder if there is a reason why the events are not sorted by the event time in the event list (project/exec/events). Seems to be that they are ordered in creation time, which depends on the position of the object in the tree, etc., right?
The command profileevents() is just a print out of this tree and his information, right?

Am I right, that the only way to figure out when will be the next event is to search through the event list with eventget(n,2) where the second parameter 2 means to look for the event time.

Is there a reason why the event list is not sorted by the time?
Otherwise it would be very easy to figure out when the next event will happen by just using eventget(1,2).

Or would it be an idea to have a command called nexteventtime() to get this time?
Or having a command called nexteventnode() to pointer on the next event node and be able with eventget() to get the time and other information?

Thanks in advance for some information.
tom the (A)tom
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions."
The Following User Says Thank You to Tom David For This Useful Post:
Lolke Koopmans (05-15-2008)
  #2  
Old 05-15-2008
Lolke Koopmans's Avatar
Lolke Koopmans Lolke Koopmans is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Posts: 42
Downloads: 21
Uploads: 0
Thanks: 24
Thanked 14 Times in 10 Posts
Rep Power: 163
Lolke Koopmans is on a distinguished road
Default

Hi Tom,

As far as I know, the current method of sorting the events is much faster then the old sorting where you could see the sequence of all events. I used this also to see what was happening in my model.
The next event is always the first one in the list.
I think it would be a good idea to change the function profileevents(), so that the events are sorted when printed. Speed is no issue here.. and you can see the real sequence of the events.
The Following User Says Thank You to Lolke Koopmans For This Useful Post:
Tom David (05-15-2008)
  #3  
Old 05-15-2008
Anthony Johnson's Avatar
Anthony Johnson Anthony Johnson is offline
Manager of Product Development
 
Join Date: Jul 2007
Posts: 440
Downloads: 86
Uploads: 4
Thanks: 171
Thanked 899 Times in 288 Posts
Rep Power: 735
Anthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond repute
Default

Tom,
The eventlist is implemented as a heap sort. This means it uses a partially ordered tree to sort the list, instead of a fully ordered tree. Lolke is right that the first event in the list is always the next event to happen. The partially ordered tree is structured such that event 1 comes before events 2 and 3, but there's not any ordered relationship between 2 and 3. Event 2 comes before events 4 and 5, event 3 comes before events 6 and 7, and so on; basically, event x will always be before event x*2 and event x*2+1. By doing this, it significantly decreases the number of checks that need to be made to put a new event into the list and to take an event out of the list.

I agree that there needs to be some command to fully sort the list, and profileevents should call that command before printing the events out. This has been put on the development list.
The Following User Says Thank You to Anthony Johnson For This Useful Post:
Tom David (05-15-2008)
  #4  
Old 05-15-2008
Tom David's Avatar
Tom David Tom David is offline
Flexsim User
 
Join Date: Aug 2007
Location: Schwaebisch Gmuend, Germany
Posts: 430
Downloads: 157
Uploads: 47
Thanks: 486
Thanked 450 Times in 233 Posts
Rep Power: 520
Tom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant future
Default

Lolke,
Anthony,

Thanks for your replies. The most important information for me was that the first event in the list is the next event which will happen.
So with eventget(1,2) I get the time when the next event will happen. That was what I was looking for.
Thanks Guys and thanks that in the future we will get some commands to sort the list. That’s just great.
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions."


Thread Thread Starter Forum Replies Last Post
Order Pulling model Roger Antillon Q&A 11 11-18-2008 09:18 AM
question about User Event Ning Wang Q&A 3 04-22-2008 10:56 AM
Find all nodes toggled as C++ Brandon Peterson Tips and Tricks 0 04-18-2008 03:36 PM
Simulation Project Engineering Positions Available Cliff King Training, Consulting, Employment 0 03-19-2008 07:13 PM
Object order in the summary report AlanZhang Q&A 4 10-16-2007 05:50 PM


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.