Small changes.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user