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 09-16-2009
Jason Lim Jason Lim is offline
Flexsim User
 
Join Date: Sep 2009
Location: Singapore
Posts: 2
Downloads: 0
Uploads: 0
Thanks: 2
Thanked 0 Times in 0 Posts
Rep Power: 0
Jason Lim is on a distinguished road
Default Newbie in need of help for school project on school bus simulation model

Hi all,
I am a final year university student using Flexsim to do my final year project to simulate the shuttle bus service within my school campus. As I am expected by my professor to pick up this software on my own, and without any prior training to using this software, I sincerely hope that the more skilled members of this forum would be able to help me in my simulation model. This is an enclosed sample simulation model that I've experimented on my own. In the model the source is supposed to be generating incoming passengers to a bus stop (represented by a queue), whereby the shuttlebuses ( represented by transporters) is picking passengers and dropping off passengers at the queues. After the passengers are dropped off at each queue, they will be sent to a sink to be "destroyed" which represents them leaving the bus stop. However what I need is to set the frequency of each bus arriving at each stop, as they are all concurrently moving off at the same time, which is what i do not want. I understand that this can be achieved by using a global timetable, but I cannot understand the instructions despite reading through the help manual, and would hope that someone would be able to show me an example on the sample model that I've attached Secondly, I would like to be able to control the number of passengers alighting and boarding at each stop, and also to make it in such a way that the shuttle bus(transporter) would only drop off passengers (flowitems) at another bus stop(queue attached to sink) and not at the same queue which it picks up its current batch of passengers(flowitems) . I would appreciate it greatly if there any kind souls who could help me out and enlighten me> Thank you very much
Attached Files
File Type: zip SIMULATION FOR BUSES WIF FIXED ROUTE.zip (53.9 KB, 226 views)
  #2  
Old 09-16-2009
Esther Bennett Esther Bennett is offline
Flexsim User
 
Join Date: Mar 2008
Posts: 115
Downloads: 27
Uploads: 0
Thanks: 103
Thanked 116 Times in 50 Posts
Rep Power: 271
Esther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to all
Default

Hello Jason,

I took a quick look at your model and have a few tips that may help you:
First of all, your Queues are not attached to each other, so you have no destination to bring your passengers to. I would suggest that you model each stop with 2 queues: 1 for passengers getting on to the bus ('entry') and one for passengers leaving the bus ('exit'). Connect the sources to the 'entry' queues and connect the 'exit' queues to a sink.
Connect each 'entry' queue of a stop to the 'exit' queues of all other stops ('A' connection). Now you can use the SendToPort options of the entry queues to define the chance a person will have to leave at a certain stop. You could add a label to a person with it's Destination. If you want you could also add a label to a person with the bus number it wants to take, if you don't want people to take just every bus.

In your model, a bus will only start to drive when there are people to be picked up. If you want to represent a bus schedule, you could create a tasksequence (TASKTYPE_TRAVEL) for a bus to travel to the different locations. You could start this tasksequence at any time and for each bus at a different time.

Expand the task sequence for a bus to do the following when it arrives at a stop: pick up the people that are waiting at the 'entry' queue (TASKTYPE_FRLOAD) and drop the people that have to get out (TASKTYPE_FRUNLOAD).
The Following 3 Users Say Thank You to Esther Bennett For This Useful Post:
Tom David (09-16-2009)
  #3  
Old 09-17-2009
Jason Lim Jason Lim is offline
Flexsim User
 
Join Date: Sep 2009
Location: Singapore
Posts: 2
Downloads: 0
Uploads: 0
Thanks: 2
Thanked 0 Times in 0 Posts
Rep Power: 0
Jason Lim is on a distinguished road
Default Improvements made but problems still remain

Hi Esther,
this is jason here, thank you very much for the tip on the schoolbus model given. I have modelled it according to your specifications, however this time round only one of the 3 buses will move and that we can only set the PROBABILITY of the number of passengers from one stop alighting at the other two stops. How could we determine the actual number of passengers alighting at the other 2 stops in the form of perhaps a poisson distribution for alighting passengers at each stop? Furthermore, could you also enlighten more on the procedure of using the tasksequence (TASKTYPE_TRAVEL), (TASKTYPE_FRLOAD) and (TASKTYPE_FRUNLOAD)? Thank you very much for your kind help.
Attached Files
File Type: zip 1232.zip (79.8 KB, 226 views)
  #4  
Old 09-18-2009
Esther Bennett Esther Bennett is offline
Flexsim User
 
Join Date: Mar 2008
Posts: 115
Downloads: 27
Uploads: 0
Thanks: 103
Thanked 116 Times in 50 Posts
Rep Power: 271
Esther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to all
Default

Hello Jason,

There are several ways to solve your problems, but you could try this (start from scratch):

For each stop make two queue's as mentioned earlier. Connect the 2 queues of on stop with a 'S' connection. Use a source to create your passengers (as you have done) and use the OnCreation trigger to create and initialize a label on you person ("Destination"). You can now use any method to set the label (custom code) value to be one of the other stops.

Add a BasicFR to your model and the number of buses you want. Connect the BasicFR to the Entry Queues with an 'A' connection and connect the Buses with a 'S' connection. Add labels to the Bus with Start and End Time.

I like to use a BasicFR, because you can keep all code together.
On the BasicFR use the OnReset trigger to send a msg for each Bus (nrcp( current) with a delay of StartTime with msgparam(1) = 1.

On the OnMessageTrigger of the BasicFR make a tasksequence for each bus. Use switch for the different type of cases:
case 1: Create a tasksequence for a bus to do the following for each stop:
  • travel to the entryqueue (TASKTYPE_TRAVEL).
  • check if there are passengers on the bus that have to get out at this stop (use TASKTYPE_CALLSUBTASKS)
  • if so, unload the passengers to the exitqueue of this stop.
  • then check if there are passengers in the entryqueue that want to get on the bus(also use TASKTYPE_CALLSUBTASKS).
when you have travelled to back to the first stop, use TASKTYPE_CALLSUBTASKS to check if you have to make a round again

The code could look something like this (travel to Stop3, unload, load, travel back to stop1):

treenode ts = createemptytasksequence( Bus );
inserttask( ts, TASKTYPE_TRAVEL, Stop3, NULL, 0, 0, 0, 0);
inserttask( ts, TASKTYPE_CALLSUBTASKS, current, NULL, 3, 3, tonum( Bus ), 0 );
inserttask( ts, TASKTYPE_CALLSUBTASKS, current, NULL, 2, 3, tonum( Bus ), 0 );
inserttask( ts, TASKTYPE_TRAVEL, Stop1, NULL, 0, 0, 0, 0);
inserttask( ts, TASKTYPE_CALLSUBTASKS, current, NULL, 4, 0, 0, 0 );
dispatchtasksequence(ts);

This is just part of the sequence, but should give you a good idea.

case 2: if the content of a bus > 0, check for each passenger if he has to get out at this stop, if so, create an TASKTYPE_UNLOAD task.

case 3: if the content of a queue >0 create a task for each person in the queue to get on the bus (TASKTYPE_LOAD)

case 4: use TASKTYPE_SENDMESSAGE to go back to case 1 if time() < EndTime

Well I hope with these hints you can create the model that you want. Also take a good look in the help file and other forum posts how to use the task sequences.

Good luck,

Esther
The Following 5 Users Say Thank You to Esther Bennett For This Useful Post:
Tom David (09-18-2009)


Thread Thread Starter Forum Replies Last Post
newbie question about scheduling transporters Victor Monell Q&A 2 03-28-2009 10:58 AM
Version 4.5 project license / demo Lolke Koopmans Product Announcements 1 01-15-2009 10:59 AM
Access flexsim-dll-project in Google Code AlanZhang Wiki Articles 0 06-27-2008 12:43 PM
Simulation Project Engineering Positions Available Cliff King Training, Consulting, Employment 0 03-19-2008 07:13 PM
School table asid_amin_o Q&A 10 02-25-2008 03:57 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.