restructure src

This commit is contained in:
Enrico Fasoli 2015-10-02 18:19:31 +02:00
parent e176fbb11e
commit 0f11295b45
11 changed files with 43 additions and 7 deletions

9
src/action.rs Normal file
View File

@ -0,0 +1,9 @@
pub struct Point {
pub x: i32,
pub y: i32
}
pub struct Action {
pub source: Point,
pub destination: Point
}

View File

View File

View File

@ -1,6 +0,0 @@
mod manager;
mod applier;
mod worker;
mod structure;
mod block;
mod action;

32
src/block.rs Normal file
View File

@ -0,0 +1,32 @@
use action::Action;
use std::vec;
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);
}
struct NeuronBlock {
connections: Vec<f64>,
current_value: f64,
new_value: f64,
}
impl Block for NeuronBlock {
fn get_connections(&self) -> &Vec<f64> {
&self.connections
}
fn get_value(&self) -> &f64 {
&self.current_value
}
fn get_name(&self) -> &'static str {
"Neuron"
}
fn compute(&self) -> Vec<Action> {
Vec::new()
}
fn clean(&self) { }
}

View File

@ -1,4 +1,5 @@
mod alrium; mod action;
mod block;
fn main() { fn main() {
println!("Hello, world!"); println!("Hello, world!");

View File