ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
This page describes the default algorithm that FlexTerm uses internally to assign ship-to-shore cranes to each berthed vessel based on the parameters given under Ship Schedule of Berth Planner. The user can also specify their own algorithm for assigning ship-to-shore cranes through the [Quay Crane Assignment](General_Attributes.html#QuayCraneAssign) trigger in Berth Planner. When ships arrive at the berth in a FlexTerm model, FlexTerm uses an algorithm to determine how many cranes to assign to each ship. The algorithm takes [crane allocation barriers](Berth_Layout.html#cranebarrier)into consideration, computing crane assignments for each area. This algorithm is recomputed whenever a ship arrives or leaves, or when a crane finishes its work on a ship. The algorithm is based on three factors for each ship - priority, requested number of cranes, and maximum number of cranes. Each of these numbers can be changed on the [Ship Schedule tab](Ship_Schedule.html)of the Berth Planner. Priority values are ordinal only, not relative. Therefore, a priority of 100 is more important than a priority of 1, but it is not 100 times more important. There are two cases the algorithm deals with: - [Too few cranes](#few) - [Extra or enough cranes](#extra) Note: In order to have a ship get as many cranes as possible (potentially starving some ships of cranes), it should be given the highest priority and an abnormally high number of requested cranes. <a name="few">Case 1: Too Few Cranes </a> <a name="few">In this case, there are not enough cranes to meet the requests of all the ships present at the berth. Therefore, the algorithm uses each ship's priority and requested number of cranes to compute how many cranes to assign to each ship. Consider the example where there are 4 cranes and 3 ships. Ship A has a priority of 5 and a request of 3. Ship B has a priority of 4 and a request of 2. Ship C has a priority of 3 and a request of 3.</a> <a name="few">![](https://box.kancloud.cn/7a36f33562c3ec0ac8258bda91d58302_630x160.png)</a> <a name="few">The algorithm follows these steps:</a> <a name="few">1. Sort the ships in ascending priority order, so the lowest priority ship is first.</a> <a name="few">![](https://box.kancloud.cn/040623ebea4bc5b1dc06d162fc15b788_237x171.png)</a> <a name="few">2. Start with an optimal scenario and assign each ship its requested amount of cranes.</a> <a name="few">![](https://box.kancloud.cn/8405dd7934eb15ae79e146f0114447ca_296x183.png)</a> <a name="few">3. Go down the sorted list and remove cranes one at a time from each ship until the actual number of available cranes is reached.</a> <a name="few">![](https://box.kancloud.cn/592bca70af22a8854358281ebbd65b8d_296x183.png)![](https://box.kancloud.cn/7d1a6f76c429e7a02a6c11c2820f3e83_295x185.png)</a> <a name="few">![](https://box.kancloud.cn/c8a65083d0acdb91e7f4a6cedbc46e9d_294x185.png)![](https://box.kancloud.cn/9e3e523d5dc0917a15e6c51df3318d85_289x184.png)</a> <a name="few">In this case, ship A is assigned 2 cranes, ship B receives 1 and ship C gets 1 as well.</a> <a name="few">![](https://box.kancloud.cn/8b877d081c08664f6a8857ae16a11748_290x183.png)</a> <a name="extra">Case 2: Extra or Enough Cranes</a> <a name="extra">In this case, there are enough or more than enough cranes to meet the requests of all the ships present at the berth. Therefore, the algorithm uses each ship's priority, requested number of cranes and maximum number of cranes to compute how many cranes to assign to each ship. Consider the example where there are 6 cranes and 3 ships. Ship A has a priority of 5, a request of 1 and a max of 3. Ship B has a priority of 4, a request of 2 and a max of 2. Ship C has a priority of 3, a request of 1 and a max of 2.</a> <a name="extra">![](https://box.kancloud.cn/5b893bda6d670aa5e8b4e2aed887eec1_628x132.png)</a> <a name="extra">The algorithm follows these steps:</a> <a name="extra">1. Sort the ships in descending priority order, so the highest priority ship is first.</a> <a name="extra">![](https://box.kancloud.cn/aa2218f78303638ff2b4dd0317344a7b_233x173.png)</a> <a name="extra">2. Start by assigning each ship its requested amount of cranes.</a> <a name="extra">![](https://box.kancloud.cn/72107423439b91b9f146e5e825784c75_292x195.png)</a> <a name="extra">3. Go down the sorted list and add cranes one at a time to each ship until the actual number of available cranes is reached. If a ship already has its maximum amount of cranes, do not add any more cranes to that ship.</a> <a name="extra">![](https://box.kancloud.cn/5e61bea1bc3ae10d50fe7b679d7ec991_277x195.png)![](https://box.kancloud.cn/ba0df5a850db2976cd83150309c5a034_277x195.png)</a> <a name="extra">In this case, ship A, B, and C are each assigned 2 cranes.</a> <a name="extra">![](https://box.kancloud.cn/fb9b5616858620532a703eb5b32c52ac_277x195.png)</a>