diff --git a/vrp-core/src/construction/enablers/mod.rs b/vrp-core/src/construction/enablers/mod.rs index 89d1e2bd7..4b557d2e6 100644 --- a/vrp-core/src/construction/enablers/mod.rs +++ b/vrp-core/src/construction/enablers/mod.rs @@ -10,9 +10,12 @@ pub use self::departure_time::*; mod feature_combinator; pub use self::feature_combinator::*; -pub mod multi_trip; +mod multi_trip; pub use self::multi_trip::*; +mod only_vehicle_activity_cost; +pub use self::only_vehicle_activity_cost::*; + mod route_intervals; pub use self::route_intervals::*; diff --git a/vrp-pragmatic/src/format/enablers/only_vehicle_activity_cost.rs b/vrp-core/src/construction/enablers/only_vehicle_activity_cost.rs similarity index 82% rename from vrp-pragmatic/src/format/enablers/only_vehicle_activity_cost.rs rename to vrp-core/src/construction/enablers/only_vehicle_activity_cost.rs index 7e58f9c93..2f9a17816 100644 --- a/vrp-pragmatic/src/format/enablers/only_vehicle_activity_cost.rs +++ b/vrp-core/src/construction/enablers/only_vehicle_activity_cost.rs @@ -1,7 +1,7 @@ -use crate::core::models::solution::Route; -use vrp_core::models::common::{Cost, Timestamp}; -use vrp_core::models::problem::{ActivityCost, SimpleActivityCost}; -use vrp_core::models::solution::Activity; +use crate::models::common::{Cost, Timestamp}; +use crate::models::problem::{ActivityCost, SimpleActivityCost}; +use crate::models::solution::Activity; +use crate::models::solution::Route; /// Uses costs only for a vehicle ignoring costs of a driver. #[derive(Default)] diff --git a/vrp-pragmatic/src/format/enablers/mod.rs b/vrp-pragmatic/src/format/enablers/mod.rs deleted file mode 100644 index 0fdf648dd..000000000 --- a/vrp-pragmatic/src/format/enablers/mod.rs +++ /dev/null @@ -1,8 +0,0 @@ -mod entities; -pub use self::entities::*; - -mod location_fallback; -pub use self::location_fallback::*; - -mod only_vehicle_activity_cost; -pub use self::only_vehicle_activity_cost::*; diff --git a/vrp-pragmatic/src/format/enablers/entities.rs b/vrp-pragmatic/src/format/entities.rs similarity index 100% rename from vrp-pragmatic/src/format/enablers/entities.rs rename to vrp-pragmatic/src/format/entities.rs diff --git a/vrp-pragmatic/src/format/enablers/location_fallback.rs b/vrp-pragmatic/src/format/location_fallback.rs similarity index 95% rename from vrp-pragmatic/src/format/enablers/location_fallback.rs rename to vrp-pragmatic/src/format/location_fallback.rs index 174623be2..34ab75a8c 100644 --- a/vrp-pragmatic/src/format/enablers/location_fallback.rs +++ b/vrp-pragmatic/src/format/location_fallback.rs @@ -3,7 +3,7 @@ use std::sync::Arc; use vrp_core::models::common::{Distance, Duration, Location, Profile}; use vrp_core::models::problem::TransportFallback; -/// A transport fallback for only custom unknown location type. +/// A transport fallback for only a custom unknown location type. /// Returns zero distance/duration for unknown type locations. pub struct UnknownLocationFallback { coord_index: Arc, diff --git a/vrp-pragmatic/src/format/mod.rs b/vrp-pragmatic/src/format/mod.rs index 5007d3158..84a82ecbf 100644 --- a/vrp-pragmatic/src/format/mod.rs +++ b/vrp-pragmatic/src/format/mod.rs @@ -16,11 +16,15 @@ use vrp_core::prelude::GenericError; mod coord_index; pub use self::coord_index::CoordIndex; +mod entities; +pub use self::entities::*; + +mod location_fallback; +pub use self::location_fallback::*; + pub mod problem; pub mod solution; -pub(crate) mod enablers; - /// Represents a location type. #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(untagged)] diff --git a/vrp-pragmatic/src/format/problem/aspects.rs b/vrp-pragmatic/src/format/problem/aspects.rs index 1e1d1b302..cb75443fe 100644 --- a/vrp-pragmatic/src/format/problem/aspects.rs +++ b/vrp-pragmatic/src/format/problem/aspects.rs @@ -1,10 +1,7 @@ -use crate::format::enablers::{BreakTie, JobTie, VehicleTie}; +use crate::format::{BreakTie, JobTie, VehicleTie}; use hashbrown::HashSet; use std::marker::PhantomData; -use vrp_core::construction::features::{ - BreakAspects, BreakCandidate, BreakPolicy, CompatibilityAspects, GroupAspects, JobSkills, JobSkillsAspects, - RechargeAspects, RechargeDistanceLimitFn, RechargeKeys, ReloadAspects, -}; +use vrp_core::construction::features::*; use vrp_core::construction::heuristics::{RouteContext, StateKey}; use vrp_core::models::common::{CapacityDimension, Demand, DemandDimension, IdDimension, LoadOps}; use vrp_core::models::problem::{Job, Single, Vehicle}; diff --git a/vrp-pragmatic/src/format/problem/clustering_reader.rs b/vrp-pragmatic/src/format/problem/clustering_reader.rs index 899285e02..7460ce78b 100644 --- a/vrp-pragmatic/src/format/problem/clustering_reader.rs +++ b/vrp-pragmatic/src/format/problem/clustering_reader.rs @@ -1,6 +1,6 @@ use super::*; -use crate::format::enablers::JobTie; use crate::format::problem::fleet_reader::get_profile_index_map; +use crate::format::JobTie; use hashbrown::HashSet; use std::cmp::Ordering; use vrp_core::construction::clustering::vicinity::*; diff --git a/vrp-pragmatic/src/format/problem/fleet_reader.rs b/vrp-pragmatic/src/format/problem/fleet_reader.rs index d400db49d..932fa100e 100644 --- a/vrp-pragmatic/src/format/problem/fleet_reader.rs +++ b/vrp-pragmatic/src/format/problem/fleet_reader.rs @@ -3,7 +3,7 @@ mod fleet_reader_test; use super::*; -use crate::format::enablers::{UnknownLocationFallback, VehicleTie}; +use crate::format::{UnknownLocationFallback, VehicleTie}; use crate::get_unique_locations; use crate::utils::get_approx_transportation; use crate::Location as ApiLocation; diff --git a/vrp-pragmatic/src/format/problem/goal_reader.rs b/vrp-pragmatic/src/format/problem/goal_reader.rs index 1e267a4ec..5aca5afe9 100644 --- a/vrp-pragmatic/src/format/problem/goal_reader.rs +++ b/vrp-pragmatic/src/format/problem/goal_reader.rs @@ -1,6 +1,6 @@ use super::*; -use crate::format::enablers::{JobTie, VehicleTie}; use crate::format::problem::aspects::*; +use crate::format::{JobTie, VehicleTie}; use hashbrown::HashSet; use vrp_core::construction::clustering::vicinity::ClusterDimension; use vrp_core::construction::enablers::{FeatureCombinator, RouteIntervals, ScheduleKeys}; diff --git a/vrp-pragmatic/src/format/problem/job_reader.rs b/vrp-pragmatic/src/format/problem/job_reader.rs index a5622331c..4d58d9c62 100644 --- a/vrp-pragmatic/src/format/problem/job_reader.rs +++ b/vrp-pragmatic/src/format/problem/job_reader.rs @@ -1,8 +1,7 @@ use crate::format::coord_index::CoordIndex; -use crate::format::enablers::{BreakTie, JobTie, VehicleTie}; use crate::format::problem::JobSkills as ApiJobSkills; use crate::format::problem::*; -use crate::format::{JobIndex, Location}; +use crate::format::{BreakTie, JobIndex, JobTie, Location, VehicleTie}; use crate::utils::VariableJobPermutation; use hashbrown::HashMap; use std::sync::Arc; diff --git a/vrp-pragmatic/src/format/problem/problem_reader.rs b/vrp-pragmatic/src/format/problem/problem_reader.rs index 64168216f..f6cdda918 100644 --- a/vrp-pragmatic/src/format/problem/problem_reader.rs +++ b/vrp-pragmatic/src/format/problem/problem_reader.rs @@ -1,9 +1,9 @@ use super::*; -use crate::format::enablers::{OnlyVehicleActivityCost, VehicleTie}; use crate::format::problem::clustering_reader::create_cluster_config; use crate::format::problem::fleet_reader::*; use crate::format::problem::goal_reader::create_goal_context; use crate::format::problem::job_reader::{read_jobs_with_extra_locks, read_locks}; +use crate::format::VehicleTie; use crate::format::{FormatError, JobIndex}; use crate::validation::ValidationContext; use crate::{parse_time, CoordIndex}; diff --git a/vrp-pragmatic/src/format/solution/activity_matcher.rs b/vrp-pragmatic/src/format/solution/activity_matcher.rs index c2003e090..43aa3fe02 100644 --- a/vrp-pragmatic/src/format/solution/activity_matcher.rs +++ b/vrp-pragmatic/src/format/solution/activity_matcher.rs @@ -1,9 +1,8 @@ -use crate::format::enablers::JobTie; use crate::format::problem::VehicleBreak; use crate::format::problem::{Problem as FormatProblem, VehicleRequiredBreakTime}; use crate::format::solution::{Activity as FormatActivity, Schedule as FormatSchedule, Tour as FormatTour}; use crate::format::solution::{PointStop, TransitStop}; -use crate::format::{CoordIndex, JobIndex}; +use crate::format::{CoordIndex, JobIndex, JobTie}; use crate::parse_time; use hashbrown::HashSet; use std::cmp::Ordering; diff --git a/vrp-pragmatic/src/format/solution/initial_reader.rs b/vrp-pragmatic/src/format/solution/initial_reader.rs index 51867f1db..56e501a89 100644 --- a/vrp-pragmatic/src/format/solution/initial_reader.rs +++ b/vrp-pragmatic/src/format/solution/initial_reader.rs @@ -2,13 +2,12 @@ #[path = "../../../tests/unit/format/solution/initial_reader_test.rs"] mod initial_reader_test; -use crate::format::enablers::{JobTie, VehicleTie}; use crate::format::solution::activity_matcher::{try_match_point_job, JobInfo}; use crate::format::solution::Activity as FormatActivity; use crate::format::solution::Stop as FormatStop; use crate::format::solution::Tour as FormatTour; use crate::format::solution::{deserialize_solution, map_reason_code}; -use crate::format::{get_indices, CoordIndex, JobIndex}; +use crate::format::{get_indices, CoordIndex, JobIndex, JobTie, VehicleTie}; use crate::parse_time; use hashbrown::{HashMap, HashSet}; use std::io::{BufReader, Read}; diff --git a/vrp-pragmatic/src/format/solution/solution_writer.rs b/vrp-pragmatic/src/format/solution/solution_writer.rs index 7d5126202..01712cd94 100644 --- a/vrp-pragmatic/src/format/solution/solution_writer.rs +++ b/vrp-pragmatic/src/format/solution/solution_writer.rs @@ -2,11 +2,11 @@ #[path = "../../../tests/unit/format/solution/writer_test.rs"] mod writer_test; -use crate::format::coord_index::CoordIndex; -use crate::format::enablers::{JobTie, VehicleTie}; use crate::format::solution::activity_matcher::get_job_tag; use crate::format::solution::model::Timing; use crate::format::solution::*; +use crate::format::CoordIndex; +use crate::format::{JobTie, VehicleTie}; use vrp_core::construction::enablers::{get_route_intervals, ReservedTimesIndex}; use vrp_core::construction::heuristics::UnassignmentInfo; use vrp_core::models::common::*; diff --git a/vrp-pragmatic/tests/helpers/core.rs b/vrp-pragmatic/tests/helpers/core.rs index e78c6ef8b..40c05233c 100644 --- a/vrp-pragmatic/tests/helpers/core.rs +++ b/vrp-pragmatic/tests/helpers/core.rs @@ -1,4 +1,4 @@ -use crate::format::enablers::{JobTie, VehicleTie}; +use crate::format::{JobTie, VehicleTie}; use std::sync::Arc; use vrp_core::construction::enablers::create_typed_actor_groups; use vrp_core::models::common::*; diff --git a/vrp-pragmatic/tests/unit/format/problem/reader_test.rs b/vrp-pragmatic/tests/unit/format/problem/reader_test.rs index 2e3440ba1..62836a986 100644 --- a/vrp-pragmatic/tests/unit/format/problem/reader_test.rs +++ b/vrp-pragmatic/tests/unit/format/problem/reader_test.rs @@ -1,5 +1,5 @@ -use crate::format::enablers::{JobTie, VehicleTie}; use crate::format::problem::*; +use crate::format::{JobTie, VehicleTie}; use crate::helpers::*; use hashbrown::HashSet; use std::iter::FromIterator;