Changeset - 79edbf0bebd7
[Not reviewed]
0 2 0
Christopher Esterhuyse - 5 years ago 2020-02-13 09:12:38
christopher.esterhuyse@gmail.com
bit business
2 files changed with 16 insertions and 0 deletions:
0 comments (0 inline, 0 general)
Cargo.toml
Show inline comments
 
[package]
 
name = "reowolf_rs"
 
version = "0.1.1"
 
authors = [
 
	"Christopher Esterhuyse <christopher.esterhuyse@gmail.com>",
 
	"Hans-Dieter Hiep <hdh@cwi.nl>"
 
]
 
edition = "2018"
 

	
 
[dependencies]
 
# hibitset = "0.6.2"
 

	
 
# runtime stuff
 
getrandom = "0.1.14" # tiny crate. used to guess controller-id
 
take_mut = "0.2.2"
 
maplit = "1.0.2" # convenience macros
 
indexmap = "1.3.0" # hashsets/hashmaps with efficient arbitrary element removal
 

	
 
# network stuff
 
integer-encoding = "1.0.7"
 
byteorder = "1.3.2"
 
mio = "0.6.21" # migrate to mio 0.7.0 when it stabilizes. It's much better.
 
mio-extras = "2.0.6"
 

	
 
# protocol stuff
 
id-arena = "2.2.1"
 
backtrace = "0.3"
 

	
 
[dev-dependencies]
 
test-generator = "0.3.0"
 
crossbeam-utils = "0.7.0"
 

	
 
[lib]
 
crate-type = ["cdylib"]
 

	
src/runtime/ecs.rs
Show inline comments
 
@@ -161,27 +161,42 @@ impl Iterator for NoneChunkIter<'_> {
 
        })
 
    }
 
}
 

	
 
#[test]
 
fn test_bit_iter() {
 
    static SETS: &[&[u32]] = &[
 
        //
 
        &[0b101001, 0b101001],
 
        &[0b100001, 0b101001],
 
    ];
 
    let _ = BitChunkIter::new(AndChunkIter::new(SETS));
 
    let iter = BitChunkIter::new(NoneChunkIter::new(SETS, 9));
 
    let indices = iter.collect::<Vec<_>>();
 
    println!("indices {:?}", indices);
 
}
 

	
 
enum Entity {
 
    Payload(Payload),
 
    State(ProtocolS),
 
}
 

	
 
fn ecs() {
 
    let entities: Vec<Entity> = Default::default();
 
    // invariant: for all ChannelId c, assignments[(c, true)] & assignments[(c, false)] == 0;
 
    let assignments: HashMap<(ChannelId, bool), BitSet> = Default::default();
 
    // invariant: for all Keys k0 != k1, keys[k0] & keys[k1] == 0;
 
    let keys: HashMap<Key, BitSet> = Default::default();
 
    // invariant: for all Keys k, keys[k] & components == 0;
 
    let components: BitSet = Default::default();
 
    // invariant: to_run &!components = 0 i.e. to_run is a subset
 
    let to_run: BitSet = Default::default();
 

	
 
    // 1.
 
}
 

	
 
/*
 
needed operations:
 

	
 
1. insert a payload and overwrite / insert its predicate assignments
 
2. run all machines that
 
*/
0 comments (0 inline, 0 general)