fixing stuff again
This commit is contained in:
parent
4e08b384c8
commit
0004fa2acf
@ -1,7 +1,4 @@
|
||||
pub struct Point {
|
||||
pub x: i32,
|
||||
pub y: i32
|
||||
}
|
||||
use util::Point;
|
||||
|
||||
pub struct Action {
|
||||
pub source: Point,
|
||||
|
14
src/block.rs
14
src/block.rs
@ -1,12 +1,16 @@
|
||||
use action::Action;
|
||||
use std::vec;
|
||||
|
||||
fn make_connections() -> Vec<f64> {
|
||||
vec![0 as f64;9]
|
||||
}
|
||||
|
||||
trait Block {
|
||||
fn get_connections(&self) -> &Vec<f64>;
|
||||
fn get_value(&self) -> &f64;
|
||||
fn get_name(&self) -> &'static str;
|
||||
fn compute(&self) -> Vec<Action>;
|
||||
fn clean(&self);
|
||||
fn compute(&mut self) -> Vec<Action>;
|
||||
fn clean(&mut self);
|
||||
}
|
||||
|
||||
struct NeuronBlock {
|
||||
@ -25,8 +29,10 @@ impl Block for NeuronBlock {
|
||||
fn get_name(&self) -> &'static str {
|
||||
"Neuron"
|
||||
}
|
||||
fn compute(&self) -> Vec<Action> {
|
||||
fn compute(&mut self) -> Vec<Action> {
|
||||
Vec::new()
|
||||
}
|
||||
fn clean(&self) { }
|
||||
fn clean(&mut self) {
|
||||
self.current_value = self.new_value
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
mod util;
|
||||
mod action;
|
||||
mod block;
|
||||
|
||||
|
4
src/util.rs
Normal file
4
src/util.rs
Normal file
@ -0,0 +1,4 @@
|
||||
pub struct Point {
|
||||
pub x: i32,
|
||||
pub y: i32
|
||||
}
|
Loading…
Reference in New Issue
Block a user