|
@@ -732,7 +732,7 @@ void Dispatch_manager::resource_allocation()
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- else if ( t_carrier_left_is_ready &&
|
|
|
+ if ( t_carrier_left_is_ready &&
|
|
|
(t_parkspace_path == Dispatch_coordinates::Parkspace_path::LEFT_PATH || t_parkspace_path == Dispatch_coordinates::Parkspace_path::DOUBLE_PATH) )
|
|
|
{
|
|
|
m_carrier_map[0]->appoint_task((*iter)->m_command_key, (*iter)->m_dispatch_process_type, Dispatch_device_base::Dispatch_task_level::DISPATCH_TASK_ONE_LEVEL);
|
|
@@ -740,7 +740,7 @@ void Dispatch_manager::resource_allocation()
|
|
|
t_allocation_flag = true;
|
|
|
break;
|
|
|
}
|
|
|
- else if ( t_carrier_right_is_ready &&
|
|
|
+ if ( t_carrier_right_is_ready &&
|
|
|
(t_parkspace_path == Dispatch_coordinates::Parkspace_path::RIGHT_PATH || t_parkspace_path == Dispatch_coordinates::Parkspace_path::DOUBLE_PATH) )
|
|
|
{
|
|
|
m_carrier_map[1]->appoint_task((*iter)->m_command_key, (*iter)->m_dispatch_process_type, Dispatch_device_base::Dispatch_task_level::DISPATCH_TASK_ONE_LEVEL);
|
|
@@ -748,18 +748,13 @@ void Dispatch_manager::resource_allocation()
|
|
|
t_allocation_flag = true;
|
|
|
break;
|
|
|
}
|
|
|
- else if ( t_carrier_3rd_is_ready && t_parkspace_path == Dispatch_coordinates::Parkspace_path::THIRD_FLOOR_PATH)
|
|
|
+ if ( t_carrier_3rd_is_ready && t_parkspace_path == Dispatch_coordinates::Parkspace_path::THIRD_FLOOR_PATH)
|
|
|
{
|
|
|
m_carrier_map[2]->appoint_task((*iter)->m_command_key, (*iter)->m_dispatch_process_type, Dispatch_device_base::Dispatch_task_level::DISPATCH_TASK_ONE_LEVEL);
|
|
|
(*iter)->set_main_carrier(m_carrier_map[2]);
|
|
|
t_allocation_flag = true;
|
|
|
break;
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- //流程和搬运器没有匹配上, 就直接找下一个流程
|
|
|
- continue;
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -778,6 +773,16 @@ void Dispatch_manager::resource_allocation()
|
|
|
bool is_2nd_path = (*iter)->is_able_store_temporary_cache_path_2nd_floor();
|
|
|
bool is_3rd_path = (*iter)->is_able_store_temporary_cache_path_3rd_floor();
|
|
|
|
|
|
+// std::cout << " huli test :::: " << " 1111111111111111 = " << 123 << std::endl;
|
|
|
+// std::cout << " huli test :::: " << " is_left_path = " << is_left_path << std::endl;
|
|
|
+// std::cout << " huli test :::: " << " is_right_path = " << is_right_path << std::endl;
|
|
|
+// std::cout << " huli test :::: " << " is_temporary_path = " << is_temporary_path << std::endl;
|
|
|
+// std::cout << " huli test :::: " << " is_2nd_path = " << is_2nd_path << std::endl;
|
|
|
+// std::cout << " huli test :::: " << " is_3rd_path = " << is_3rd_path << std::endl;
|
|
|
+// std::cout << " huli test :::: " << " 2222222222222222 = " << 567 << std::endl;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
//如果只能存到缓存位, 那么也要执行, 修改标志位
|
|
|
if ( (!is_left_path) && (!is_right_path) && is_temporary_path)
|
|
|
{
|
|
@@ -817,7 +822,7 @@ void Dispatch_manager::resource_allocation()
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- else if ( t_carrier_left_is_ready )
|
|
|
+ if ( t_carrier_left_is_ready )
|
|
|
{
|
|
|
if ( is_left_path ||
|
|
|
( (!is_left_path) && (!is_right_path) && is_2nd_path) )//如果只能存到2楼, 那么也要执行
|
|
@@ -828,7 +833,7 @@ void Dispatch_manager::resource_allocation()
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- else if ( t_carrier_right_is_ready )
|
|
|
+ if ( t_carrier_right_is_ready )
|
|
|
{
|
|
|
if ( is_right_path ||
|
|
|
( (!is_left_path) && (!is_right_path) && is_2nd_path) )//如果只能存到2楼, 那么也要执行
|
|
@@ -839,7 +844,7 @@ void Dispatch_manager::resource_allocation()
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- else if ( t_carrier_3rd_is_ready)
|
|
|
+ if ( t_carrier_3rd_is_ready)
|
|
|
{
|
|
|
if ( (!is_left_path) && (!is_right_path) && is_3rd_path)
|
|
|
{
|
|
@@ -849,10 +854,6 @@ void Dispatch_manager::resource_allocation()
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- continue;
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -913,7 +914,7 @@ void Dispatch_manager::resource_allocation()
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- else if ( t_carrier_left_is_pickup &&
|
|
|
+ if ( t_carrier_left_is_pickup &&
|
|
|
(t_parkspace_path == Dispatch_coordinates::Parkspace_path::LEFT_PATH || t_parkspace_path == Dispatch_coordinates::Parkspace_path::DOUBLE_PATH) )
|
|
|
{
|
|
|
m_carrier_map[0]->appoint_task((*iter)->m_command_key, (*iter)->m_dispatch_process_type, Dispatch_device_base::Dispatch_task_level::DISPATCH_TASK_ONE_LEVEL);
|
|
@@ -921,7 +922,7 @@ void Dispatch_manager::resource_allocation()
|
|
|
t_allocation_flag = true;
|
|
|
break;
|
|
|
}
|
|
|
- else if ( t_carrier_right_is_pickup &&
|
|
|
+ if ( t_carrier_right_is_pickup &&
|
|
|
(t_parkspace_path == Dispatch_coordinates::Parkspace_path::RIGHT_PATH || t_parkspace_path == Dispatch_coordinates::Parkspace_path::DOUBLE_PATH) )
|
|
|
{
|
|
|
m_carrier_map[1]->appoint_task((*iter)->m_command_key, (*iter)->m_dispatch_process_type, Dispatch_device_base::Dispatch_task_level::DISPATCH_TASK_ONE_LEVEL);
|
|
@@ -929,18 +930,13 @@ void Dispatch_manager::resource_allocation()
|
|
|
t_allocation_flag = true;
|
|
|
break;
|
|
|
}
|
|
|
- else if ( t_carrier_3rd_is_pickup && t_parkspace_path == Dispatch_coordinates::Parkspace_path::THIRD_FLOOR_PATH)
|
|
|
+ if ( t_carrier_3rd_is_pickup && t_parkspace_path == Dispatch_coordinates::Parkspace_path::THIRD_FLOOR_PATH)
|
|
|
{
|
|
|
m_carrier_map[2]->appoint_task((*iter)->m_command_key, (*iter)->m_dispatch_process_type, Dispatch_device_base::Dispatch_task_level::DISPATCH_TASK_ONE_LEVEL);
|
|
|
(*iter)->set_main_carrier(m_carrier_map[2]);
|
|
|
t_allocation_flag = true;
|
|
|
break;
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- //流程和搬运器没有匹配上, 就直接找下一个流程
|
|
|
- continue;
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -951,6 +947,16 @@ void Dispatch_manager::resource_allocation()
|
|
|
{
|
|
|
if ( !t_allocation_flag )
|
|
|
{
|
|
|
+ //没有分配的
|
|
|
+ int t_need_allocation_size = 0;
|
|
|
+ for (auto iter = m_process_store_list.begin(); iter != m_process_store_list.end(); ++iter)
|
|
|
+ {
|
|
|
+ if ( !(*iter)->is_ready() )
|
|
|
+ {
|
|
|
+ t_need_allocation_size++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//然后做存车
|
|
|
for (auto iter = m_process_store_list.begin(); iter != m_process_store_list.end(); ++iter)
|
|
|
{
|
|
@@ -966,7 +972,7 @@ void Dispatch_manager::resource_allocation()
|
|
|
|
|
|
//如果只能存到缓存位, 或者存车流程数量超限, 修改标志位
|
|
|
if ( ( (!is_left_path) && (!is_right_path) && is_temporary_path) ||
|
|
|
- (m_process_store_list.size() >= DISPATCH_MANAHER_STORE_LIST_SIZE_LIMIT && is_temporary_path) )
|
|
|
+ (t_need_allocation_size >= DISPATCH_MANAHER_STORE_LIST_SIZE_LIMIT && is_temporary_path) )
|
|
|
{
|
|
|
(*iter)->m_temporary_cache_flag = true;
|
|
|
}
|
|
@@ -977,38 +983,39 @@ void Dispatch_manager::resource_allocation()
|
|
|
//分配合理的版搬运器
|
|
|
if ( t_carrier_left_is_store && t_carrier_right_is_store)
|
|
|
{
|
|
|
- if ( (is_left_path && is_right_path) ||
|
|
|
- ( (!is_left_path) && (!is_right_path) && is_2nd_path) || //如果只能存到2楼, 那么也要执行
|
|
|
- (m_process_store_list.size() >= DISPATCH_MANAHER_STORE_LIST_SIZE_LIMIT && is_2nd_path) ) //存车流程数量超限
|
|
|
+ if ( ( (*iter)->m_temporary_cache_flag && is_2nd_path) ||
|
|
|
+ ( (!(*iter)->m_temporary_cache_flag) && is_left_path && is_right_path) )
|
|
|
{
|
|
|
- //选最近的搬运器
|
|
|
- if ( Dispatch_coordinates::get_instance_references().choice_nearest_carrier(
|
|
|
- (*iter)->m_dispatch_source, tp_carrier_left->m_actual_coordinates_id,
|
|
|
- tp_carrier_right->m_actual_coordinates_id) )
|
|
|
+ if ( is_2nd_path )
|
|
|
{
|
|
|
- m_carrier_map[0]->appoint_task((*iter)->m_command_key,
|
|
|
- (*iter)->m_dispatch_process_type,
|
|
|
- Dispatch_device_base::Dispatch_task_level::DISPATCH_TASK_ONE_LEVEL);
|
|
|
- (*iter)->set_main_carrier(m_carrier_map[0]);
|
|
|
- t_allocation_flag = true;
|
|
|
- break;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- m_carrier_map[1]->appoint_task((*iter)->m_command_key,
|
|
|
- (*iter)->m_dispatch_process_type,
|
|
|
- Dispatch_device_base::Dispatch_task_level::DISPATCH_TASK_ONE_LEVEL);
|
|
|
- (*iter)->set_main_carrier(m_carrier_map[1]);
|
|
|
- t_allocation_flag = true;
|
|
|
- break;
|
|
|
- }
|
|
|
+ //选最近的搬运器
|
|
|
+ if ( Dispatch_coordinates::get_instance_references().choice_nearest_carrier(
|
|
|
+ (*iter)->m_dispatch_source, tp_carrier_left->m_actual_coordinates_id,
|
|
|
+ tp_carrier_right->m_actual_coordinates_id) )
|
|
|
+ {
|
|
|
+ m_carrier_map[0]->appoint_task((*iter)->m_command_key,
|
|
|
+ (*iter)->m_dispatch_process_type,
|
|
|
+ Dispatch_device_base::Dispatch_task_level::DISPATCH_TASK_ONE_LEVEL);
|
|
|
+ (*iter)->set_main_carrier(m_carrier_map[0]);
|
|
|
+ t_allocation_flag = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ m_carrier_map[1]->appoint_task((*iter)->m_command_key,
|
|
|
+ (*iter)->m_dispatch_process_type,
|
|
|
+ Dispatch_device_base::Dispatch_task_level::DISPATCH_TASK_ONE_LEVEL);
|
|
|
+ (*iter)->set_main_carrier(m_carrier_map[1]);
|
|
|
+ t_allocation_flag = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- else if ( t_carrier_left_is_store )
|
|
|
+ if ( t_carrier_left_is_store )
|
|
|
{
|
|
|
- if ( is_left_path ||
|
|
|
- ( (!is_left_path) && (!is_right_path) && is_2nd_path) || //如果只能存到2楼, 那么也要执行
|
|
|
- (m_process_store_list.size() >= DISPATCH_MANAHER_STORE_LIST_SIZE_LIMIT && is_2nd_path) ) //存车流程数量超限
|
|
|
+ if ( ( (*iter)->m_temporary_cache_flag && is_2nd_path) ||
|
|
|
+ ( (!(*iter)->m_temporary_cache_flag) && is_left_path ) )
|
|
|
{
|
|
|
m_carrier_map[0]->appoint_task((*iter)->m_command_key, (*iter)->m_dispatch_process_type, Dispatch_device_base::Dispatch_task_level::DISPATCH_TASK_ONE_LEVEL);
|
|
|
(*iter)->set_main_carrier(m_carrier_map[0]);
|
|
@@ -1016,11 +1023,10 @@ void Dispatch_manager::resource_allocation()
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- else if ( t_carrier_right_is_store )
|
|
|
+ if ( t_carrier_right_is_store )
|
|
|
{
|
|
|
- if ( is_right_path ||
|
|
|
- ( (!is_left_path) && (!is_right_path) && is_2nd_path) || //如果只能存到2楼, 那么也要执行
|
|
|
- (m_process_store_list.size() >= DISPATCH_MANAHER_STORE_LIST_SIZE_LIMIT && is_2nd_path) ) //存车流程数量超限
|
|
|
+ if ( ( (*iter)->m_temporary_cache_flag && is_2nd_path) ||
|
|
|
+ ( (!(*iter)->m_temporary_cache_flag) && is_right_path) )
|
|
|
{
|
|
|
m_carrier_map[1]->appoint_task((*iter)->m_command_key, (*iter)->m_dispatch_process_type, Dispatch_device_base::Dispatch_task_level::DISPATCH_TASK_ONE_LEVEL);
|
|
|
(*iter)->set_main_carrier(m_carrier_map[1]);
|
|
@@ -1028,10 +1034,9 @@ void Dispatch_manager::resource_allocation()
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- else if ( t_carrier_3rd_is_store)
|
|
|
+ if ( t_carrier_3rd_is_store)
|
|
|
{
|
|
|
- if ( ( (!is_left_path) && (!is_right_path) && is_3rd_path) || //如果只能存到3楼, 那么也要执行
|
|
|
- (m_process_store_list.size() >= DISPATCH_MANAHER_STORE_LIST_SIZE_LIMIT && is_3rd_path) ) //存车流程数量超限
|
|
|
+ if ( (*iter)->m_temporary_cache_flag && is_3rd_path )
|
|
|
{
|
|
|
m_carrier_map[2]->appoint_task((*iter)->m_command_key, (*iter)->m_dispatch_process_type, Dispatch_device_base::Dispatch_task_level::DISPATCH_TASK_ONE_LEVEL);
|
|
|
(*iter)->set_main_carrier(m_carrier_map[2]);
|
|
@@ -1039,10 +1044,6 @@ void Dispatch_manager::resource_allocation()
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- continue;
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
}
|