Change time to use i64 instead of u64

This commit is contained in:
2022-06-28 23:18:55 +02:00
parent 6125a81696
commit 22c61d47b1
8 changed files with 117 additions and 22 deletions

View File

@@ -206,8 +206,8 @@ impl History {
(step, i)
}
pub fn learning_curves(&self) -> HashMap<Index, Vec<(u64, Gaussian)>> {
let mut data: HashMap<Index, Vec<(u64, Gaussian)>> = HashMap::new();
pub fn learning_curves(&self) -> HashMap<Index, Vec<(i64, Gaussian)>> {
let mut data: HashMap<Index, Vec<(i64, Gaussian)>> = HashMap::new();
for b in &self.batches {
for agent in b.skills.keys() {
@@ -235,7 +235,7 @@ impl History {
&mut self,
composition: Vec<Vec<Vec<Index>>>,
results: Vec<Vec<f64>>,
times: Vec<u64>,
times: Vec<i64>,
weights: Vec<Vec<Vec<f64>>>,
) {
self.add_events_with_prior(composition, results, times, weights, HashMap::new())
@@ -245,7 +245,7 @@ impl History {
&mut self,
composition: Vec<Vec<Vec<Index>>>,
results: Vec<Vec<f64>>,
times: Vec<u64>,
times: Vec<i64>,
weights: Vec<Vec<Vec<f64>>>,
priors: HashMap<Index, Player>,
) {
@@ -302,7 +302,7 @@ impl History {
while i < n {
let mut j = i + 1;
let t = if self.time { times[o[i]] } else { i as u64 + 1 };
let t = if self.time { times[o[i]] } else { i as i64 + 1 };
while self.time && j < n && times[o[j]] == t {
j += 1;
@@ -329,7 +329,7 @@ impl History {
let a = self.agents.get_mut(agent).unwrap();
a.last_time = if self.time { b.time } else { u64::MAX };
a.last_time = if self.time { b.time } else { i64::MAX };
a.message = b.forward_prior_out(agent);
}
@@ -359,7 +359,7 @@ impl History {
for a in b.skills.keys() {
let agent = self.agents.get_mut(a).unwrap();
agent.last_time = if self.time { t } else { u64::MAX };
agent.last_time = if self.time { t } else { i64::MAX };
agent.message = b.forward_prior_out(a);
}
} else {
@@ -379,7 +379,7 @@ impl History {
for a in b.skills.keys() {
let agent = self.agents.get_mut(a).unwrap();
agent.last_time = if self.time { t } else { u64::MAX };
agent.last_time = if self.time { t } else { i64::MAX };
agent.message = b.forward_prior_out(a);
}
@@ -406,7 +406,7 @@ impl History {
let a = self.agents.get_mut(agent).unwrap();
a.last_time = if self.time { b.time } else { u64::MAX };
a.last_time = if self.time { b.time } else { i64::MAX };
a.message = b.forward_prior_out(agent);
}