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 02-14-2012
ericdaoust ericdaoust is offline
Flexsim User
 
Join Date: Nov 2011
Location: Sudbury, Ontario, Canada
Posts: 13
Downloads: 6
Uploads: 0
Thanks: 5
Thanked 1 Time in 1 Post
Rep Power: 103
ericdaoust is on a distinguished road
Default Locating physical neighbours of objects

I am building a model that will simulate the mining of an ore body in an underground mine. The blocks of ore are represented as flow items (ie they cannot be connected to other objects). Suppose all blocks are 1x1x1 in size, and I want to mine a block at position (5,3,3) next. I can't get to it directly because other blocks are in the way. One way to get to (5,3,3) is to mine (5,3,1) first and then (5,3,2). I need a structure to store the neighbour relationship between objects so that I can quickly know which blocks to mine first to clear the way to the block I am targeting.

One method that I found is to store this information in a global table (for each block, store the name of their direct neighbour in each direction). Another way is to convert my script to C++ code and store a 3-dimensional array containing pointers to the object in the adjacent position (block (5,3,3) would be stored at position 5,3,3 in the array). I just don't know how to store this information globally.

Do you have any recommendations? Is the global table the best way to go? Is there an easier way to quickly get neighbour information of objects displayed in the model?

Thanks in advance.
  #2  
Old 02-14-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: 773
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

Take a look at the NamedConnections development thread which will allow you to connect items and read the relationships easily.

Attached is a simple model that shows the relationships for creating a stack in a queue. The realtionships that are created are called "above" and "below". The code is on the Queue entry trigger which uses the user commands (which are in the NamedConnections library).

If, at the start you fill a rack as floor storage, then you'd perhaps use the rack commands along with the bay, level and height to figure out the positions and then set up the relationships. Of course if you can do that, perhaps that's quicker than making these links.
Attached Files
File Type: fsm MiningBlocks.fsm (60.1 KB, 88 views)
The Following User Says Thank You to Jason Lightfoot For This Useful Post:
ericdaoust (02-14-2012)
  #3  
Old 02-15-2012
ericdaoust ericdaoust is offline
Flexsim User
 
Join Date: Nov 2011
Location: Sudbury, Ontario, Canada
Posts: 13
Downloads: 6
Uploads: 0
Thanks: 5
Thanked 1 Time in 1 Post
Rep Power: 103
ericdaoust is on a distinguished road
Default

The rack idea is a good one because of indexing. The level/bay concept is easy as they become x/y indices when the rack is on the floor. But the height concept eludes me because it seems that the rack wants to stack flowitems starting at the lowest point. In the ore body it is possible that a block has no "down" neighbour so I would want a blank space underneath (ie I want to control the elevation of each block that I insert).

I can think of two approaches:
-create an invisible box in a position with no ore block
-create one rack for every Z-elevation in the ore body

I believe that having a different rack for each Z-elevation is the way to go but I welcome feedback.
  #4  
Old 02-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: 773
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

You could load up the rack while creating the links and then just delete the blocks where nothing exists - the ones above stay where they are. Deleting a block also deletes any links to it on other blocks.

Attached is a model that creates the links above, below, north, south, east and west. The link setup code is again on the entrytrigger.

To test, just right click an item/block and set as so(). Then open a script and run getconnected(so(),"above") and replace "above" with the direction names from the previous paragraph (I was going to write ' from above' - confusing ). You'll see the script returns a pointer to the block in the direction you specified.
Attached Files
File Type: fsm MiningBlocks2.fsm (66.8 KB, 85 views)

Last edited by Jason Lightfoot; 02-15-2012 at 05:24 PM.
The Following 2 Users Say Thank You to Jason Lightfoot For This Useful Post:
Jörg Vogel (02-16-2012)
  #5  
Old 03-06-2012
ericdaoust ericdaoust is offline
Flexsim User
 
Join Date: Nov 2011
Location: Sudbury, Ontario, Canada
Posts: 13
Downloads: 6
Uploads: 0
Thanks: 5
Thanked 1 Time in 1 Post
Rep Power: 103
ericdaoust is on a distinguished road
Default

I ended up going with the rack idea. Prior to hitting 'Run' I execute a script that inserts items into the rack as described in the prior post. However when I click 'Run' some of my flowitems are moved to the front of the rack for no reason while other flowitems are changed to red colour. This is not the behaviour I want - I just want the rack to be a placeholder for items and do nothing else. Is there anything special that I have to do stop this from happening?

Thanks again.
  #6  
Old 03-06-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: 773
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

A few options here:
1) record the height when the block enters the rack and the when an item is transported out restore all the heights of the other objects in the same bay and level
2) Instead of unloading the block, try a moveobject or just destroy it.
3) Override the exit logic (last resort)

As for turning red - is that something to do with marking bays that have called for transport in the Rack GUI page?
  #7  
Old 03-06-2012
ericdaoust ericdaoust is offline
Flexsim User
 
Join Date: Nov 2011
Location: Sudbury, Ontario, Canada
Posts: 13
Downloads: 6
Uploads: 0
Thanks: 5
Thanked 1 Time in 1 Post
Rep Power: 103
ericdaoust is on a distinguished road
Default

Quote:
Originally Posted by Jason Lightfoot View Post
A few options here:
1) record the height when the block enters the rack and the when an item is transported out restore all the heights of the other objects in the same bay and level
2) Instead of unloading the block, try a moveobject or just destroy it.
3) Override the exit logic (last resort)

As for turning red - is that something to do with marking bays that have called for transport in the Rack GUI page?
I have the marking bays ready option turned off yet some blocks still turn red. I am already using moveobject to move the boxes into the rack in my script. I simply want the rack to not do anything once I hit Run. The boxes should not move at all during the execution.

The scripting is nice but the built-in functionality is what is causing the problems.
  #8  
Old 03-06-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: 773
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

Can you post your model or a small example?
  #9  
Old 03-08-2012
ericdaoust ericdaoust is offline
Flexsim User
 
Join Date: Nov 2011
Location: Sudbury, Ontario, Canada
Posts: 13
Downloads: 6
Uploads: 0
Thanks: 5
Thanked 1 Time in 1 Post
Rep Power: 103
ericdaoust is on a distinguished road
Default

Disregard what I wrote. When working on other parts of the model I decided to add a buildall() at the end of my script and that took care of the bizarre rack behaviour. Thanks for all the help!


Thread Thread Starter Forum Replies Last Post
change the objects in self modeled objects Manuel Kraenzle Q&A 7 10-27-2008 02:29 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.