Perform various data analysis on SEC 13-F and obtain some insights of fund activities such as number of holdings, AUM, and change of holdings between two quarters.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Build OR-Tools RoutingModel vehicle-routing models with transit matrices, dimensions, capacity constraints, time windows, optional visits, invalid-arc handling, search parameters, and route extraction.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.
Use this skill for vehicle-routing models built with ortools.constraint_solver.pywrapcp.RoutingModel.
NaN; OR-Tools can silently treat bad values as usable arcs.manager.NodeToIndex(node) and manager.IndexToNode(index).RegisterTransitMatrix and RegisterUnaryTransitVector calls over Python callbacks. Routing callbacks are called very often during local search and can consume solve time on large instances.When an input matrix has one shared start depot and one shared end depot, but the routing model needs one start and end node per vehicle, build an internal matrix with cloned depots:
def clone_depots_matrix(external, job_nodes, num_vehicles, start_depot, end_depot, invalid_cost):
num_jobs = len(job_nodes)
start_nodes = list(range(num_jobs, num_jobs + num_vehicles))
end_nodes = list(range(num_jobs + num_vehicles, num_jobs + 2 * num_vehicles))
matrix = [[invalid_cost] * (num_jobs + 2 * num_vehicles) for _ in range(num_jobs + 2 * num_vehicles)]
for i, ext_i in enumerate(job_nodes):
for j, ext_j in enumerate(job_nodes):
matrix[i][j] = external[ext_i][ext_j]
for end in end_nodes:
matrix[i][end] = external[ext_i][end_depot]
for start in start_nodes:
for j, ext_j in enumerate(job_nodes):
matrix[start][j] = external[start_depot][ext_j]
for vehicle in range(num_vehicles):
matrix[start_nodes[vehicle]][end_nodes[vehicle]] = 0
return matrix, start_nodes, end_nodes
Time.CumulVar(index) is the arrival or service-start time, and departure is arrival + service_time.fix_start_cumul_to_zero deliberately. Use False when vehicle start times or shifts may vary; use start time windows or allowed start values instead.routing.Start(vehicle) and routing.End(vehicle), especially when depots are cloned or shared.Apply ordinary visit time windows directly to the node's time cumul:
for node, (window_low, window_high) in time_windows.items():
index = manager.NodeToIndex(node)
time_dim.CumulVar(index).SetRange(int(window_low), int(window_high))
For top-of-hour shift starts inside an operating window, generate the allowed start values and apply them to each vehicle start cumul:
def possible_shift_start_times(operating_window, shift_duration, step_minutes=60):
start, end = operating_window
return [
minute
for minute in range(0, 24 * 60 + 1, step_minutes)
if start <= minute <= end - shift_duration
]
shift_starts = possible_shift_start_times(operating_window, shift_duration)
for vehicle in range(num_vehicles):
time_dim.CumulVar(routing.Start(vehicle)).SetRange(*operating_window)
time_dim.CumulVar(routing.End(vehicle)).SetRange(*operating_window)
time_dim.CumulVar(routing.Start(vehicle)).SetValues(shift_starts)
time_dim.SetSpanUpperBoundForVehicle(shift_duration, vehicle)
routing.AddVariableMinimizedByFinalizer(time_dim.CumulVar(routing.Start(vehicle)))
routing.AddVariableMaximizedByFinalizer(time_dim.CumulVar(routing.End(vehicle)))
AddDisjunction for optional nodes and choose penalties so the primary objective dominates secondary route costs.Use this shape for large matrix-based routing models with cloned depots, time propagation, capacity, a secondary travel-cost objective, and a bounded local search. Add problem-specific visits, disjunctions, and time windows after creating the dimensions.
from ortools.constraint_solver import pywrapcp, routing_enums_pb2
start_nodes = list(range(job_node_count, job_node_count + num_vehicles))
end_nodes = list(range(job_node_count + num_vehicles, job_node_count + 2 * num_vehicles))
manager = pywrapcp.RoutingIndexManager(num_solver_nodes, num_vehicles, start_nodes, end_nodes)
routing = pywrapcp.RoutingModel(manager)
nodes_from_indices = [manager.IndexToNode(index) for index in range(manager.GetNumberOfIndices())]
time_matrix = [
[int(travel_times[i][j] + service_times[i]) for j in nodes_from_indices]
for i in nodes_from_indices
]
cost_matrix = [
[int(arc_costs[i][j]) for j in nodes_from_indices]
for i in nodes_from_indices
]
time_cb = routing.RegisterTransitMatrix(time_matrix)
cost_cb = routing.RegisterTransitMatrix(cost_matrix)
routing.SetArcCostEvaluatorOfAllVehicles(cost_cb)
routing.AddDimension(time_cb, waiting_slack, time_horizon, False, "Time")
time_dim = routing.GetDimensionOrDie("Time")
demand_cb = routing.RegisterUnaryTransitVector([int(demands[node]) for node in nodes_from_indices])
routing.AddDimensionWithVehicleCapacity(demand_cb, 0, vehicle_capacities, True, "Capacity")
params = pywrapcp.DefaultRoutingSearchParameters()
params.first_solution_strategy = routing_enums_pb2.FirstSolutionStrategy.AUTOMATIC
params.local_search_metaheuristic = routing_enums_pb2.LocalSearchMetaheuristic.GENERIC_TABU_SEARCH
params.time_limit.seconds = int(search_limit_seconds)
params.log_search = True
solution = routing.SolveWithParameters(params)
AUTOMATIC is a strong first-solution default, and GENERIC_TABU_SEARCH is often a good local-search metaheuristic for escaping local minima. Avoid assuming that simple arc-based constructors such as PATH_CHEAPEST_ARC will work well on heavily constrained optional-service instances.search_parameters.log_search = True, run Python unbuffered, or print flushed progress before and after the solve.NextVar, route start/end cumul vars, and CostVar; keep the best collected solution by cost if the final return value is unavailable or inconvenient to extract.NextVar from each vehicle start to end, then pass the ordered stops to an independent audit/reporting step.아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.
로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.
아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.
Perform various data analysis on SEC 13-F and obtain some insights of fund activities such as number of holdings, AUM, and change of holdings between two quarters.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
AC branch pi-model power flow equations (P/Q and |S|) with transformer tap ratio and phase shift, matching `acopf-math-model.md` and MATPOWER branch fields. Use when computing branch flows in either direction, aggregating bus injections for nodal balance, checking MVA (rateA) limits, computing branch loading %, or debugging sign/units issues in AC power flow.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Redact text from PDF documents for blind review anonymization
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Use when checking simplified ADA-derived plan-view bathroom accessibility constraints such as turning space, door clear width, toilet centerline, grab bars, and lavatory knee/toe clearance.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Analyze failed GitHub Action jobs for a pull request.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Use when extracting plan-view architectural geometry from DXF files with semantic CAD layers, especially when outputs must normalize rooms, doors, fixtures, clearances, and grab bars into machine-checkable JSON.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.