Skip to content

Commit b05f59e

Browse files
Update toolchain version to 1.81
1 parent db42c14 commit b05f59e

File tree

6 files changed

+13
-18
lines changed

6 files changed

+13
-18
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM rust:1.80-alpine AS Builder
1+
FROM rust:1.81-alpine AS Builder
22

33
LABEL maintainer="Ilya Builuk <ilya.builuk@gmail.com>" \
44
org.opencontainers.image.title="A Vehicle Routing Problem solver CLI" \

experiments/heuristic-research/src/solver/proxies.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,8 @@ where
147147
}
148148

149149
fn select<'a>(&'a self) -> Box<dyn Iterator<Item = &Self::Individual> + 'a> {
150-
Box::new(self.inner.select().map(|individual| {
150+
Box::new(self.inner.select().inspect(|&individual| {
151151
self.acquire().on_select.entry(self.generation).or_default().push(individual.into());
152-
153-
individual
154152
}))
155153
}
156154

rosomaxa/src/utils/environment.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ impl Parallelism {
115115
}
116116

117117
/// Executes operation on thread pool with given index. If there is no thread pool with such
118-
/// index, then executes it without using any of thread pools.
118+
/// an index, then execute it without using any of thread pools.
119119
pub fn thread_pool_execute<OP, R>(&self, idx: usize, op: OP) -> R
120120
where
121121
OP: FnOnce() -> R + Send,
@@ -128,7 +128,7 @@ impl Parallelism {
128128
}
129129
}
130130

131-
/// Returns amount of thread pools used. Returns zero if default thread pool is used.
131+
/// Returns number of non-default thread pools. Returns zero if only default thread pool is used.
132132
pub fn thread_pool_size(&self) -> usize {
133133
self.thread_pools.as_ref().map_or(0, |tp| tp.len())
134134
}

rosomaxa/src/utils/iterators.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ pub fn create_range_sampling_iter<I: Iterator>(
108108
/// The general idea is to sample values from the sequence uniformly, find the best from them and
109109
/// check adjusted range, formed by these sampled values. The general motivation is that in many
110110
/// domains values are not distributed randomly and this approach can quickly explore promising
111-
/// regions and start exploiting them, significantly reducing total amount of probes.
111+
/// regions and start exploiting them, significantly reducing the total number of probes.
112112
///
113113
/// For example:
114114
///
@@ -124,7 +124,7 @@ pub fn create_range_sampling_iter<I: Iterator>(
124124
/// - 6 sample: 58 at 11
125125
/// - 7 sample: 31 at 12
126126
/// - here we found a better maximum (58), so we update current best and continue with further shrinking the search range
127-
/// - we repeat the process till trivial range is reached
127+
/// - we repeat the process till trivial (empty) range is reached
128128
///
129129
pub trait SelectionSamplingSearch: Iterator {
130130
/// Searches using selection sampling algorithm.
@@ -185,13 +185,13 @@ pub trait SelectionSamplingSearch: Iterator {
185185
}
186186
}
187187

188-
// avoid evaluating same item twice by checking the probe
188+
// avoid evaluating the same item twice by checking the probe
189189
if is_new_item {
190190
let item_value = map_fn(item);
191191
// if a new found, set the search range to adjusted left and right items
192192
if compare_fn(&item_value, best_value) {
193193
acc.best = BestItem::Fresh((item_idx, item_value));
194-
// keep same index for left/right if it is a first/last probe
194+
// keep the same index for left/right if it is a first/last probe
195195
acc.left = if probe_idx == 0 { acc.left } else { acc.last + 1 };
196196
acc.right = if probe_idx == last_probe_idx { orig_right } else { item_idx };
197197
}
@@ -245,7 +245,7 @@ impl<T> Debug for BestItem<T> {
245245
}
246246
}
247247

248-
/// Keeps track of search state for selection sampling search.
248+
/// Keeps track of search state for selection sampling search.
249249
struct SearchState<const N: usize, T> {
250250
left: usize,
251251
right: usize,

rosomaxa/src/utils/types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use std::ops::ControlFlow;
88

99
/// Alias to a scalar floating type.
1010
///
11-
/// NOTE: Currently, prefer to use `f64` as a default floating type as switching to `f32` leads
12-
/// to precision issues within solution checker (at least). No clear performance benefits were not found.
11+
/// NOTE: Currently, prefer to use `f64` as a default floating type as switching to `f32` leads
12+
/// to precision issues within the solution checker (at least). No clear performance benefits were found.
1313
pub type Float = f64;
1414

1515
/// Unwraps value from inner state.

vrp-cli/src/lib.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,8 @@ mod c_interop {
221221

222222
#[test]
223223
fn can_use_callback() {
224+
// TODO: real check that data is passed is not really there
225+
224226
extern "C" fn success1(_: *const c_char) {}
225227
extern "C" fn failure1(_: *const c_char) {
226228
unreachable!()
@@ -232,11 +234,6 @@ mod c_interop {
232234
}
233235
extern "C" fn failure2(_: *const c_char) {}
234236
call_back(Err("failure".into()), success2, failure2);
235-
236-
let result = std::panic::catch_unwind(|| {
237-
call_back(Err("failure".into()), success1, failure1);
238-
});
239-
assert!(result.is_err());
240237
}
241238

242239
#[test]

0 commit comments

Comments
 (0)