Small changes.

This commit is contained in:
2020-02-21 14:37:32 +01:00
parent eae717b840
commit eae980a74c
2 changed files with 5 additions and 3 deletions

View File

@@ -38,7 +38,7 @@ impl BinaryModel {
pub fn add_item(&mut self, name: &str, kernel: Box<dyn Kernel>) {
if self.storage.contains_key(name) {
// raise ValueError("item '{}' already added".format(name))
panic!("item '{}' already added", name);
}
self.storage.insert(
@@ -49,7 +49,7 @@ impl BinaryModel {
pub fn observe(&mut self, winners: &[&str], losers: &[&str], t: f64) {
if t < self.last_t {
// raise ValueError("observations must be added in chronological order")
panic!("observations must be added in chronological order");
}
let mut elems = self.process_items(winners, 1.0);
@@ -66,9 +66,11 @@ impl BinaryModel {
self.observations.push(obs);
/*
for (item, _) in elems {
// item.link_observation(obs)
item.link_observation(obs)
}
*/
self.last_t = t;
}