ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
The Container Placement tab page is used to define strategies for placing containers within a [yard block](YardBlock.html). The [Block Assignments](Block_Assignments.html)tab determines which block the container goes to, after which one of these search strategies is used to find the container's final location in the block. A search strategy is composed of a series of smaller "searches." A search is a condition that the yard block must meet in order to be a match. These searches will be evaluated one by one in the order as defined in the Search Order list for the particular search. If a search matches, then the container is placed according to that search. Searches are explained in greater detail below. Note that FlexTerm will not evaluate a bay or a cell if it cannot place a container into the bay or cell. This could聽happen if: - A聽bay or a cell is already full. - A聽bay or a cell cannot place a container due to the size restriction. FlexTerm will not mix a 40ft bay with a 20ft bay. For example, if there is a container in聽bay 2 (40ft bay) or in bay 3, FlexTerm will not evaluate bay 4 for a 40ft container due to the restriction. Tab Page Details ![](https://box.kancloud.cn/ab808029e6105163bb4b4ddf2bf4ea27_681x453.png) Strategies List - This list shows the search strategies that you have defined for your model. To add a new strategy, click the Add Strategy button. To delete a selected strategy, click the Delete Strategy button. To edit a strategy, highlight it in the list. Search Strategy Name聽 - This value is the name assigned to the search strategy. <a name="SearchSelection">Strategy Selection List</a><a name="SearchSelection">- The Available Searches list contains all of the searches you can choose from. Use the </a><a name="SearchSelection">![](https://box.kancloud.cn/1cf9b2e6345c2e796140e9da10ae0c09_20x18.jpg)and ![](https://box.kancloud.cn/90311765855b3d0e1819ae88dd4a21dd_20x18.jpg)buttons to add or remove searches in the search strategy. The Search Order list contains the searches that are used, in order, for that strategy.</a> <a name="SearchSelection">Available searches include:</a> - <a name="SearchSelection">Segregated bay</a><a name="SearchSelection"> - this is a bay that holds containers of the same type. Note that here the type does not have the same meaning as the container type defined in </a>[Container Types](Container_Types.html)window. Here the type is defined in the Segregate By of the [Yard Block](YardBlock.html) window for each block. For example, if Type and Size are selected in the Segregate By for a block, then containers with the same Type and Size will be considered as the same segregation type. Which segregation type the bay is segregated on is determined by the first container put into the bay. Similar concepts apply to Segregated cell as well. - <a name="SearchSelection">Segregated filling bay </a><a name="SearchSelection">- this is a bay that is segregated and is currently being filled (no container has been removed from the bay since it started filling). This facilitates orderliness in the yard so that bays are filled up then emptied, then refilled. </a> - <a name="SearchSelection">Empty bay</a><a name="SearchSelection"> - this is a bay that has no containers. </a> - <a name="SearchSelection">Segregated cell</a><a name="SearchSelection">聽 - this is a cell that holds containers of聽the same type (stacked up). </a> - <a name="SearchSelection">Segregated filling cell</a><a name="SearchSelection"> - this is a cell that is segregated and is currently being filled. </a> - <a name="SearchSelection">Empty cell of mixed bay</a><a name="SearchSelection"> - this is an empty cell in a bay that is no longer segregated. </a> - <a name="SearchSelection">Empty cell of empty bay</a><a name="SearchSelection"> - this is an empty cell in an empty bay. </a> - <a name="SearchSelection">Empty cell</a><a name="SearchSelection"> - this is a cell with no containers. </a> - <a name="SearchSelection">Less than full mixed cell</a><a name="SearchSelection"> - this is a cell that is not stacked to the tier limit and has various container types. The tier limit is defined in the Number of Tiers High of the </a>[Yard Block](YardBlock.html) window for each block. - <a name="SearchSelection">Less than full mixed filling cell</a><a name="SearchSelection"> - this is a cell that is not stacked to the tier limit, has various container types, and is currently being filled. </a> - <a name="SearchSelection">Less than full cell</a><a name="SearchSelection">- this is a cell that is not stacked to the tier limit. </a> - <a name="SearchSelection">Less than full filling cell</a><a name="SearchSelection"> - this is a cell that is not stacked to the tier limit and is currently being filled. </a> - <a name="SearchSelection">Least full mixed cell</a><a name="SearchSelection">- this is a cell that may be stacked beyond the tier limit and has various container types. This option is useful to keep segregated cells from becoming mixed. </a> - <a name="SearchSelection">Least full cell</a><a name="SearchSelection"> - this is whichever cell is least full, regardless of container type or tier height. This search is typically used as the final search in a strategy to ensure that the container will be placed somewhere, thus avoiding failed container placement errors.</a> <a name="SearchSelection">If the above searches do not meet your requirements, you can define your own search either as a Weighted Search or a Custom Search, both of which are explained below. After defining the search, it will appear in the Available Searches list. You can then add it to your search strategy like any other search.</a> Note: If segregated bay or segregated filling bay is desired, the empty bay search should directly follow the segregated bay search in the search order. 聽For example, if you want to segregate bays you should have the following searches in the search order: 1) Segregated bay 2) Empty bay. The same rule applies for segregated cells. 聽If segregated cell or segregated filling cell is desired, the empty cell search should directly follow the segregated cell search in the search order: 聽1) Segregated cell 2) Empty cell. <a name="weightedsearch">Weighted Search</a> A weighted search is a search through the entire block or area the container is assigned to. Every cell gets a score based聽on different values for that position. The container is placed in the cell with the HIGHESTscore. You define the parameters of the weighted search by assigning scores to any or all of the optional values. Scores can be positive or negative, depending on your objectives. Some scores are multiplied by the distance or number of containers; these scores are often smaller so they will be properly balanced with other scores on the page. ![](https://box.kancloud.cn/2db31b110067b3912d4c352d5265d8db_381x453.png) The first four scores are binary types of weights. That means, the score is calculated by multiplying the input value with a binary variable, i.e. 1 if the criteria is met or 0 otherwise. - Segregated- The score is applied if the bay or cell holds containers of聽the same segregation value. If the considered container matches the segregation criteria for the bay or cell, then the weight will be applied. - Empty- The score is applied if the bay or cell has no containers. The empty cell score is typically a negative value as you want to give penalty to empty slots when the terminal is busy. - Filling- The score is applied if the bay or cell is currently filling, which means that no container has been removed since the last time the bay or cell was empty.聽 - Break Segregation - This score will be added to the overall score if the location is already segregated, but for a different segregation type than the container that is being assigned, so that if the container were to be assigned to that location, the segregation would necessarily be "broken." This value, if used, should be a negative value, denoting a penalty to the overall score. The next seven scores are multiplier types of weights. That means, the score is calculated by muliplying the input value with the measurement from the simulation. - Number of Containers- The score is multiplied by the number of containers in that bay or cell. A negative score means you want to spread containers out while a positive score means you want to pack containers together.聽 - Stacking Trucks in Transit To- The score is multiplied by the number of trucks that are currently traveling to the block for stacking operations. A stacking operation means to drop off a container to the block. This typically receives a negative score in order to help spread out traffic to different blocks. - Unstacking Trucks in Transit To- The score is multiplied by the number of trucks that are currently traveling to the block for unstacking operations. An unstacking operation means to pick up a container from the block. This typically receives a negative score in order to help spread out traffic to different blocks. - Truck Travel Distance- The score is multiplied by the number of meters (or feet, or inches, etc. depending on the model distance units) that the truck has to travel to the block. This typically receives a negative score to prevent trucks from traveling long distances unnecessarily. If the truck is not connected to a network, the straight line distance from the center of the truck to the center of the block will be used. If the truck is connected to a network, the distance will include the two parts. Part 1 is the straight line distance from the center of the truck to the node that the truck will enter the network. Part 2 is the shortest distance for the truck to travel along the network from the entry node to the exit node that connects to the block and through which the truck will exit the network. - Covered Dwell Time (Days)- The score is multiplied by the number of days (may be a decimal value) that a container has left until it leaves, or the remaining time in days. Only the top container is considered. This typically receives a positive score so that new containers will not be placed on top of containers that are leaving soon. - Yard Resource Travel Distance- The score is multiplied by the number of meters (or feet, or inches, etc.) the assigned yard resource must travel from its current location. This typically receives a negative score so that yard resources can work in one area before moving to another. The distance is from the center of the bay to the center of the resource. - Yard Resource Task Queue Content- The score is multiplied by the number of tasks in the queue of the assigned yard resource. This typically receives a negative score in order to spread out the work across the yard. The number of tasks include those in the tasksequencequeue as well as the active tasksequence of the yard resource. The last score is a special type which will be directly added onto the total score. - Random- The score is a random value between 0 and the specified score. This score can be used to break any ties. If the above values do not meet your requirements, you can define your own weighted search on the Other tab, as shown below. ![](https://box.kancloud.cn/1570d7410e6c006d67b3cdb098f0093f_380x454.png) - Find Best Block First - This checkbox provides an alternative search technique. If this box is checked, FlexTerm will choose the best block first, then execute the weighted search on each bay in the block. If this box is unchecked, FlexTerm will execute the weighted search on each bay in the entire area. Checking this box will speed up the search, but will cause different results. - Find Best Bay First - This checkbox provides an alternative search technique. If this box is checked, FlexTerm will choose the best bay first, then execute the weighted search on each cell in the bay. If this box is unchecked, FlexTerm will execute the weighted search on each cell in the entire block or area. Checking this box will speed up the search, but will cause different results. - Minimum Acceptable Score - If the score returned is below this specified value, then the search will not return any cell, but rather continue to the next search in the Search Order. - Custom Weighting - In the code box you can write code to compute a custom weighted value. The code is executed for each cell in the search area and must return a numerical value that represents your custom score for that cell. The custom score is added to the weights on the scores tab to calculate a total score for that cell. The parameters that are passed into this code field are as follows: - parval(1) - the id of the container being assigned. - parnode(2) - the current block being searched. - parval(3) - the yard member index of the current block being searched. - parval(4) - the rank of the block in the area being searched. If you are only searching one block as part of the whole search, then this will only be 1, but if you are searching several blocks in an area, then this will be 1 for the first block in the area, 2 for the second, etc. - parval(5) - the current bay number being scored. - parval(6) - the current cell number being scored. - parnode(7) - the truck that is carrying the container if there is one. NULL if no truck involved. - parnode(8) - the assigned stacking resource (i.e., RTG, TopLoader, etc.) if there is a weight for the stacking resource. - parval(9) - the current accumulated weight for the block/bay/cell so far. The sequence by which this code field is called is described as follows: First, FlexTerm will query the code field for what type of weights it would like to customize, by calling it once for a given container assignment, with no associated block/bay/cell. The return value will then be used to determine how subsequent calls to the code field should be made. The return value for this call should be a bitwise OR of one or more of the following values:聽0x4 for custom block scoring code, 0x2 for custom bay scoring code, and 0x1 for custom cell scoring code. So your custom weighting code should have some initial code that looks similar to the following: `if(parval(3) == 0) // no block聽聽聽聽return 0x4 | 0x2 | 0x1;`Once FlexTerm knows which types of custom scoring your code wants, it will call the code again with the associated blocks/bays/cells needed. For example, if you return 0x4 in the initial call (block scoring), then FlexTerm will call your custom code once for each block in the area being searched (for these calls, bay and cell numbers, i.e. parval(5) and parval(6), will be 0). The聽value your code returns will then be added into the cumulative block score, and will be reflected in the total score for each cell in the search. Some useful commands for this are: - getblockstat(obj block, num query, num bay, num cell, num tier) - getcontainerstat(num containerid, num query) Custom Search A custom search is a search algorithm you write entirely. Generally, the search begins by calling getsearchstat() to find out how many blocks to search, the start bay, end bay, start cell, and end cell. Next each block is evaluated using getblockstat() to get values on the block and determine which cell meets your criteria. Finally, getsearchstat() is used again to pass in the block, bay, and cell that were decided on. ![](https://box.kancloud.cn/3bd4c03a382fb7527cb22ba1cc3e298d_575x274.png) Within the scope of the search the following parameters are available: - parval(1) - The container id that is being assigned. - parnode(2) - The truck that will take the container to the stack (if one exists). This will be null if the container's from field is the yard, at initial model population at time 0, or if you are not using trucks. - getsearchstat(num query, num block, num bay, num cell) - This command gives you information about the current search. It also gives some information about each block for the search, such as the block's fill direction, tiers high, number of cells, number of bays, etc. It also lets you set the return block, bay and position once you have found which one you want. The first parameter designates the query type. The other parameters designate a block, bay, or cell for the query, and may not be required depending on the query. The query type can be one of the following: - SEARCH\_STAT\_NR\_OF\_BLOCKS - returns number of blocks in the search, no extra parameters required. - SEARCH\_STAT\_BLOCK - returns a reference to a block in the search. The block parameter is required. - SEARCH\_STAT\_BLOCK\_INDEX - returns a yard member index of a block in the search. The block parameter is required.聽 - SEARCH\_STAT\_NR\_OF\_BAYS - returns the number of bays for a given block. The block parameter is required. - SEARCH\_STAT\_NR\_OF\_LEVELS - returns the number of cells for a given block. The block parameter is required. - SEARCH\_STAT\_TIERS\_HIGH - returns the tiers high, or the number of containers that the block is supposed to stack high. The block parameter is required. - SEARCH\_STAT\_MAX\_BAY\_CONTENT - returns the block's max bay content. The block parameter is required.聽 - SEARCH\_STAT\_BAY\_FILL\_DIRECTION - returns the block's bay fill direction (1 or 0). You will probably not need this because you will use startbay, endbay, and bayincrement in your loops. The block parameter is required. - SEARCH\_STAT\_CELL\_FILL\_DIRECTION - returns the block's cell fill direction (1 or 0). You will probably not need this because you will use startbay, endbay, and bayincrement in your loops. The block parameter is required. - SEARCH\_STAT\_START\_BAY - returns the bay number to start at in your bay search. The block parameter is required. - SEARCH\_STAT\_END\_BAY - returns the bay number to end at in your bay search. Use the example below as a template for making your own loops. The block parameter is required. - SEARCH\_STAT\_BAY\_INCREMENT - returns the bay increment variable. Use the example below to create your own loops. The block parameter is required. - SEARCH\_STAT\_START\_CELL - returns the cell number to start at. The block parameter is required. - SEARCH\_STAT\_END\_CELL - returns the cell number to end at. The block parameter is required. - SEARCH\_STAT\_CELL\_INCREMENT - returns the cell increment value. The block parameter is required. - SEARCH\_STAT\_SET\_RETURN\_POS - sets the "return position" for the search. You will execute this command just before you return. The block, bay, and cell parameters are required. Note you must also return the block's search index as in the example below. - SEARCH\_STAT\_COMPARE\_SEGREGATION - compares the segregation of a given block's bay/cell with the current container's attributes. Returns 1 if they match or 0 if they do not match. The block and bay parameters are required. The cell parameter can also be used if you want to see if an individual cell is segregated for the container type. - SEARCH\_STAT\_RESOURCE - causes the yard to read the resource assignment table and find a yard resource (RTG, top loader) that would be assigned for a given block. The block parameter is required. Bay and cell parameters are optional. - getblockstat(obj block, num query, num bay, num cell, num tier) - This command gets information about an individual block's bays and cells. The first parameter is a reference to the block object (this will be returned by the SEARCH\_STAT\_BLOCK query). The second parameter is the query, and the other parameters designate bay, cell, and tier and may be optional depending on the query. The query type can be one of the following: - BLOCK\_STAT\_CONTAINER\_ID - gets the container id number of a given bay, cell, and tier. All parameters are required. - BLOCK\_STAT\_SEGREGATED - returns "segregated" attribute of a bay or cell. 1 means segregated and 0 means not segregated. The bay parameter is required and the cell parameter is optional. - BLOCK\_STAT\_FILLING - returns the "filling" attribute of a bay or cell. 1 means filling, meaning no container has been unstacked since the bay or cell was originally stacked from the empty state. The bay parameter is required and the cell parameter is optional. - BLOCK\_STAT\_CONTENT - returns the content of the bay or cell. The bay parameter is required and the cell parameter is optional. - BLOCK\_STAT\_BAY\_BLOCKED - returns whether the bay is "blocked" by other bay content. For example, if bay 4 holds containers, then bays 2,3,5, and 6 may not hold containers because bay 4 infringes on part or all of the space for those bays. In this case bays 2,3,5 and 6 will have their "bay blocked" attribute set to 1. - BLOCK\_STAT\_IN\_TRANSIT\_STACKING - returns the number of trucks that are in transit to stack that bay or cell. The bay parameter is required and the cell parameter is optional. - BLOCK\_STAT\_IN\_TRANSIT\_UNSTACKING - returns the number of trucks that are in transit to unstack that bay or cell. The bay parameter is required and the cell parameter is optional. Example 1 - Empty Cell Search ![](https://box.kancloud.cn/7686dea9e0073d399e201731014c4497_592x427.png) Example 2 - Segregated Bay Search ![](https://box.kancloud.cn/9e248419b9c24f06d7e88ea6964157a0_593x713.png)