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 04-08-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 Rail API

I've posted a Rail API library to the downloads section:
http://www.flexsim.com/community/for...do=file&id=127

Check it out!
The Following 7 Users Say Thank You to Anthony Johnson For This Useful Post:
Vinay Mehendiratta (04-09-2008)
  #2  
Old 04-21-2008
qin tian qin tian is offline
Flexsim User
 
Join Date: Dec 2007
Location: Shanghai, China
Posts: 137
Downloads: 115
Uploads: 0
Thanks: 59
Thanked 3 Times in 3 Posts
Rep Power: 161
qin tian is on a distinguished road
Default

It seems that it is not compatible with flexsim4.3
  #3  
Old 04-22-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

Check the following file: railapifunctions.h
You will find the sentence "uncomment the following to be compatible with 4.3"
If you do this, it will work in flexsim 4.3

regards,
Lolke
The Following 2 Users Say Thank You to Lolke Koopmans For This Useful Post:
qin tian (04-27-2008)
  #4  
Old 05-06-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 direction of edges are not uniform

Anthony,

I was working with your Rail API (It is great! ) when Flexsim just shut down (like with an infinite loop). I found out that this was because I tried to send a train over a network of edges with different directions.
When I used your beta version of the library (where you had to compile), I used to get an error pop-up box telling me:
"Could not create path because direction of edges are not uniform."

Is it possible to re-introduce the error-message? That would make modelling and certainly debugging easier! Thanks!

Lolke
  #5  
Old 05-06-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

Lolke,
I just checked the code, and the logic is the same as the c++ version that I gave you a while back (the error message is still implemented in the code), so from what I can tell, your issue must be something else. I know that the current RailAPI will crash when you compile Flexsim unless you add /DELAYLOAD:RailAPI.dll to Flexsim4\program\config\flexsimexeB.txt. Is that when you're getting the crash?

Your question brings up an issue that we've not clearly decided here at Flexsim, and about which I'm undecided myself, namely how do we support the rail API. It's a really cool library, but we haven't set it up to be an income-generator as yet, so we don't know exactly how/if we want to support it, except through projects that we get in the rail industry. We've considered open-sourcing it, but if we do that, we'd want some commitment from others that they will indeed help to improve it (I think there are a lot of improvements that can be made to it), so we can benefit from the open source, and not just the users. Or maybe we set it up through maintenance contracts with customers (since we've already given it away, and since it's still "half-baked" in my opinion, I don't think it's sellable yet, but we can sell support for it).

Anyway, what are your thoughts? I think it's a great library, but it's a pretty small niche market, which means that it's not worth it to us right now to just maintain it for free for our customers.
  #6  
Old 05-07-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

Thanks for your answer, Anthony.
I do not compile, so that is not the problem. I am pretty sure the problem is in the direction of the edges. I could reproduce the problem if the direction was not uniform and I solved the problem completely by making sure the direction is always correct (without changing anything else in the model).

I really like the library a lot and I am using it in 2 projects right now. You are probably right that it is a small niche market, but we are working a lot with train movements. And from the other thread we saw that there is more interest in this area.
I can see that supporting the library is an issue since you gave the library away. I like the idea of open sourcing, but I have to say I didn't change a word of your code. I am using it as it is for the movements of the trains, for allocating the edges and for checking and listening for the allocations.
If you want to sell / support it, you have to think who your customers are. I can use it as it is. But I can imagine that someone less experienced with flexsim or using functions, will need more explanation / help or even a training.
Our customers will not be interested in buying or using the library, since we build the models for them.

When I speak for myself, using the library, I think I can get pretty far without any support. But this is only true if I can see the code. If it is in a dll and I can't see what is happening it is much more difficult to find out.

Regards,
Lolke
The Following User Says Thank You to Lolke Koopmans For This Useful Post:
Anthony Johnson (05-07-2008)
  #7  
Old 05-07-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

Lolke,
Thanks for your thoughts. Given your input and my own thoughts on it, I'm leaning toward just leaving the RailAPI "as-is" with no guarantees, no support. Improvements will be made on a per-project basis, when we get projects here at Flexsim. I agree that there has lately been an increase in interest in simulation doing rail operations. We'll see how/if that leads to improvements in the rail API.
Thanks,
Anthony
  #8  
Old 12-25-2009
LINWEIXU
Guest
 
Posts: n/a
Downloads:
Uploads:
Default

can anyone give a more complicated examples use Rail API,i do not know how to use it? i make a simple mode like RailAPISample,but it can not run,I don't know how to start.
Attached Files
File Type: zip train1.zip (51.9 KB, 257 views)

Last edited by LINWEIXU; 12-25-2009 at 07:27 AM.
  #9  
Old 12-27-2009
LINWEIXU
Guest
 
Posts: n/a
Downloads:
Uploads:
Smile

Quote:
Originally Posted by Lolke Koopmans View Post
Thanks for your answer, Anthony.
I do not compile, so that is not the problem. I am pretty sure the problem is in the direction of the edges. I could reproduce the problem if the direction was not uniform and I solved the problem completely by making sure the direction is always correct (without changing anything else in the model).

I really like the library a lot and I am using it in 2 projects right now. You are probably right that it is a small niche market, but we are working a lot with train movements. And from the other thread we saw that there is more interest in this area.
I can see that supporting the library is an issue since you gave the library away. I like the idea of open sourcing, but I have to say I didn't change a word of your code. I am using it as it is for the movements of the trains, for allocating the edges and for checking and listening for the allocations.
If you want to sell / support it, you have to think who your customers are. I can use it as it is. But I can imagine that someone less experienced with flexsim or using functions, will need more explanation / help or even a training.
Our customers will not be interested in buying or using the library, since we build the models for them.

When I speak for myself, using the library, I think I can get pretty far without any support. But this is only true if I can see the code. If it is in a dll and I can't see what is happening it is much more difficult to find out.

Regards,
Lolke
hi ,can you tell some thing about " allocating the edges and for checking and listening for the allocations.",i can not understand it, perhaps you can give me example model,I would appreciate you, and i do not know how to use continuefromrailwait(node sequence), when i use addrailwait(node sequence), where can i use continuefromrailwait(node sequence),in that place how can i get "node sequence". and i want to use addrailsendmessage(node sequence, node toobject, node fromobj, num code, num delaytime) ,i confuse "The rail sequence will not continue until
the continuefromrailwait() command is executed independent of the rail sequence"
in attach i I try to use continuefromrailwait() but I failed
can fromobj be " sequence ".can anyone give some
idea????????
Attached Files
File Type: zip train2.zip (99.3 KB, 252 views)
  #10  
Old 12-28-2009
LINWEIXU
Guest
 
Posts: n/a
Downloads:
Uploads:
Default

i test one day,Finally understand "allocating the edges and for checking and listening for the allocations." but i also do not know how to use continuefromrailwait(node sequence), and can not understand delayrailmoveatswitches(node railmove, num delaytime, num maxspeed, num acc, num dec, num shortdist); i set delaytime smaller,but move slower,i do not know why.there is A few examples, it is so difficult.

I made an example that use "allocating the edges and for checking and listening for the allocations." to Help later learners

can anybody help me????? thank you
Attached Files
File Type: zip train3.zip (64.6 KB, 266 views)
The Following User Says Thank You to For This Useful Post:
Hao Zhou (12-17-2010)
  #11  
Old 12-29-2009
LINWEIXU
Guest
 
Posts: n/a
Downloads:
Uploads:
Default

i think there is something wrong in command
"delayrailmoveatswitches(node railmove, num delaytime, num maxspeed, num acc, num dec, num shortdist)".

Description: Searches through the rail moves entire path and changes the move so that the train will stop short of the switch and wait for the delaytime at the switch before resuming on.
Example: delayrailmoveatswitches(railmove, 5,1,0,0)

can i expain this for "train move along path and stop at switch and wait for the delaytime then resuming on.''

i write code "delayrailmoveatswitches(move, 1.5, 1,2, 3,1.5);"

Kinematic data - Last Updated Location: [7.50,0.00,0.00] Rotation: [0.00, 0.00, 0.00]
Start Time: 0.00 End Time: 9.35 Last Update Time: 0.04
Initial Location: [7.50,0.00,0.00] Initial Rotation: [0.00, 0.00, 0.00]
2 Kinematics Added
Travel [6.50, 0.00, 0.00] totaldist: 6.50 starttime: 0.00 endtime: 5.08 startspeed: 0.00 endspeed: 1.50l acc1: 1.00 acc2: 1.00 peakspeed: 1.50 acc1time: 1.50 peaktime: 3.58 acc2time: 0.00
Travel [5.83, 0.00, 0.00] totaldist: 5.83 starttime: 5.08 endtime: 9.35 startspeed: 1.50 endspeed: 0.00l acc1: -2.00 acc2: -2.00 peakspeed: 1.50 acc1time: 0.00 peaktime: 3.51 acc2time: 0.75

1.5 is speed ,not delaytime,"1,2"are acc and dec , not maxspeed and acc.

i test again

delayrailmoveatswitches(move, 3, 2, 3,4,5);

Kinematic data - Last Updated Location: [0.00,0.00,0.00] Rotation: [0.00, 0.00, 0.00]
Start Time: 0.00 End Time: 8.54 Last Update Time: -1.06
Initial Location: [7.50,0.00,0.00] Initial Rotation: [0.00, 0.00, 0.00]
5 Kinematics Added
Travel [6.77, 0.00, 0.00] totaldist: 6.77 starttime: 0.00 endtime: 3.01 startspeed: 0.00 endspeed: 3.00l acc1: 2.00 acc2: 2.00 peakspeed: 3.00 acc1time: 1.50 peaktime: 1.51 acc2time: 0.00
Travel [3.22, 0.00, 0.00] totaldist: 3.22 starttime: 3.01 endtime: 4.08 startspeed: 3.00 endspeed: 3.00l acc1: -3.00 acc2: 2.00 peakspeed: 3.00 acc1time: 0.00 peaktime: 1.07 acc2time: 0.00
Travel [7.50, 0.00, 0.00] totaldist: 7.50 starttime: 4.08 endtime: 6.58 startspeed: 3.00 endspeed: 3.00l acc1: -3.00 acc2: 2.00 peakspeed: 3.00 acc1time: -0.00 peaktime: 2.50 acc2time: 0.00
Travel [0.76, 0.00, 0.00] totaldist: 0.76 starttime: 6.58 endtime: 6.83 startspeed: 3.00 endspeed: 3.00l acc1: -3.00 acc2: 2.00 peakspeed: 3.00 acc1time: -0.00 peaktime: 0.25 acc2time: 0.00
Travel [3.61, 0.00, 0.00] totaldist: 3.61 starttime: 6.83 endtime: 8.54 startspeed: 3.00 endspeed: 0.00l acc1: -3.00 acc2: -3.00 peakspeed: 3.00 acc1time: -0.00 peaktime: 0.70 acc2time: 1.00

can some body tell why????????
  #12  
Old 01-04-2010
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

The continuefromrailwait() command is used in conjunction with the addrailwait() command. If you've added a rail wait operation, then when the train gets to that operation in the sequence, it will just stop its progression in the sequence. Then, calling continuefromrailwait() will signal the rail sequence to finish the wait operation and continue to the next operation. It is very similar to the TASKTYPE_UTILIZE, where the TaskExecuter waits in this task until the modeler calls freeoperators().

For delayrailmoveatswitches(), it looks like we changed the functionality and then forgot to change the documentation. The delaytime parameter no longer exists, so parameter 2 is really maxspeed, parameter 3 is acc, etc. In order to make it more flexible, we moved the definition of the delay time to be defined on each network node's label named "switch_throw_time". Also, the network nodes have additional labels defining which switch configuration is a "turnout" configuration, and if needed, a maximum speed that the train can be traveling over the switch if the switch is in its "turnout" configuration. All of these label values are considered to create a potentially complex set of kinematics when you call delayrailmoveatswitches().
The Following User Says Thank You to Anthony Johnson For This Useful Post:
Carsten Seehafer (01-04-2010)
  #13  
Old 01-05-2010
LINWEIXU
Guest
 
Posts: n/a
Downloads:
Uploads:
Default

thank you very much,ringht now i know how to use continuefromrailwait(),we can get reference ( sequence) from tree.
can you give me a few small example about delayrailmoveatswitches(),
  #14  
Old 01-09-2010
LINWEIXU
Guest
 
Posts: n/a
Downloads:
Uploads:
Default

addrailmove(node sequence, node railpath, num speed, num acc, num dec, num length, num deallocateid [, num
coupledecoupleoffset])
Description: Adds a rail move operation to a rail sequence. Specify the path that the railmove applies
to. Distance is measured from the first node of the edge, where the first node is the node
you dragged from when 'A' connecting. Length is the total amount of space that the set
of travelers will take up, or the train size. The travelers will travel the total distance of
the edge(s) minus the length, meaning the length will be completely inclusive within the
distance of the edge(s). Specify viaedge if you want to travel through a particular edge
on the way to the destination edge. This command returns a reference to a node
representing the rail move operation. For more information, refer to createrailsequence().
If deallocateid is not 0, then as the train clears edges on the network, it will deallocate
those edges, based on the given id. Refer to couplerailtraveler for more information on
the coupledecoupleoffset parameter.


how to "Specify viaedge if you want to travel through a particular edge
on the way to the destination edge. "

createrailpath(num fromedge, num fromdist, num toedge, num todist, num via_1, num via_2, num via_3)

what is mean "num via_1, num via_2, num via_3", do they have relationship with "Specify viaedge if you want to travel through a particular edge on the way to the destination edge. "

i try to use "via_1, num via_2, num via_3" but they do not affect.
see attach
Attached Files
File Type: zip lianxi.zip (44.7 KB, 244 views)
  #15  
Old 07-01-2010
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

I've updated the Rail API to be compatible with version 5. http://www.flexsim.com/community/for...do=file&id=127
The Following 3 Users Say Thank You to Anthony Johnson For This Useful Post:
Tom David (07-01-2010)
  #16  
Old 12-06-2010
LINWEIXU
Guest
 
Posts: n/a
Downloads:
Uploads:
Default

Quote:
Originally Posted by LINWEIXU View Post
addrailmove(node sequence, node railpath, num speed, num acc, num dec, num length, num deallocateid [, num
coupledecoupleoffset])
Description: Adds a rail move operation to a rail sequence. Specify the path that the railmove applies
to. Distance is measured from the first node of the edge, where the first node is the node
you dragged from when 'A' connecting. Length is the total amount of space that the set
of travelers will take up, or the train size. The travelers will travel the total distance of
the edge(s) minus the length, meaning the length will be completely inclusive within the
distance of the edge(s). Specify viaedge if you want to travel through a particular edge
on the way to the destination edge. This command returns a reference to a node
representing the rail move operation. For more information, refer to createrailsequence().
If deallocateid is not 0, then as the train clears edges on the network, it will deallocate
those edges, based on the given id. Refer to couplerailtraveler for more information on
the coupledecoupleoffset parameter.


how to "Specify viaedge if you want to travel through a particular edge
on the way to the destination edge. "

createrailpath(num fromedge, num fromdist, num toedge, num todist, num via_1, num via_2, num via_3)

what is mean "num via_1, num via_2, num via_3", do they have relationship with "Specify viaedge if you want to travel through a particular edge on the way to the destination edge. "

i try to use "via_1, num via_2, num via_3" but they do not affect.
see attach
why Anthony Johnson do not answer me this question???????
  #17  
Old 12-07-2010
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

Sorry, yes the via_1, via_2, and via_3 parameters are the same as viaedge. They allow you to define one or multiple edges through which you want the path the traverse.
  #18  
Old 12-07-2010
LINWEIXU
Guest
 
Posts: n/a
Downloads:
Uploads:
Default

Quote:
Originally Posted by Anthony Johnson View Post
Sorry, yes the via_1, via_2, and via_3 parameters are the same as viaedge. They allow you to define one or multiple edges through which you want the path the traverse.
thank you Anthony. i try to use "via_1, num via_2, num via_3" but they do not affect.
today , i test it again but they do not had no effect .
  #19  
Old 12-09-2010
LINWEIXU
Guest
 
Posts: n/a
Downloads:
Uploads:
Default

Anthony Johnson , do you test it? had this command changed or somethings else? please tell us.
  #20  
Old 12-10-2010
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

ViaEdgeSample:
Attached Files
File Type: zip ViaEdgeSample.zip (43.2 KB, 221 views)
The Following User Says Thank You to Anthony Johnson For This Useful Post:
Hao Zhou (12-17-2010)



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.