pub struct TeamAssembly;Expand description
Team Assembly as a NetworkModel.
Trait Implementations§
Source§impl Debug for TeamAssembly
impl Debug for TeamAssembly
Source§impl NetworkModel for TeamAssembly
impl NetworkModel for TeamAssembly
Source§fn prepare_view(nodes: &mut Nodes<'_, Self>, tick: u64)
fn prepare_view(nodes: &mut Nodes<'_, Self>, tick: u64)
Colours the last team’s members and labels the components, if the graph has changed since they were last labelled.
Source§fn stats(_lanes: &TeamLanes, graph: &Network, aux: &TeamAux) -> Vec<StatValue>
fn stats(_lanes: &TeamLanes, graph: &Network, aux: &TeamAux) -> Vec<StatValue>
Returns the link counts by colour, the share of nodes in the giant component and the mean component size.
The component stats are the values that Self::prepare_view last computed.
Source§const ID: &'static str = "team_assembly"
const ID: &'static str = "team_assembly"
Stable id that identifies the model in a model set, on the command line and in a spec file.
Source§const DESCRIPTION: &'static str = "Teams of newcomers and incumbents grow a collaboration network."
const DESCRIPTION: &'static str = "Teams of newcomers and incumbents grow a collaboration network."
One-line description shown in the UI.
Source§const EDGE_PALETTE: &'static [[u8; 4]]
const EDGE_PALETTE: &'static [[u8; 4]]
Edge colours, indexed by each edge’s colour byte.
Source§const STATS: &'static [StatDescriptor]
const STATS: &'static [StatDescriptor]
Stat series shown in the history chart.
Source§const DEFAULT_NODES: u32 = 4
const DEFAULT_NODES: u32 = 4
Default of
num_agents, the node count.Source§const DEFAULT_EXTENT: Extent
const DEFAULT_EXTENT: Extent
World the layout spreads nodes over. It is used for drawing only.
Source§const LAYOUT: SpringParams
const LAYOUT: SpringParams
Constants of the spring layout.
Source§type Params = TeamParams
type Params = TeamParams
Hot parameters, extracted once per tick.
Source§type Aux = TeamAux
type Aux = TeamAux
Model state kept outside the lanes and the graph, or
() for a model without such state.Source§fn param_descriptors() -> Vec<ParamDescriptor>
fn param_descriptors() -> Vec<ParamDescriptor>
Returns the model’s own parameters, which follow the engine’s
num_agents, world_width and world_height.Source§fn from_params(params: &[ParamValue], _extent: Extent) -> TeamParams
fn from_params(params: &[ParamValue], _extent: Extent) -> TeamParams
Extracts the hot parameters for one tick from this model’s own slice of the params.
Source§fn init(
nodes: &mut Nodes<'_, Self>,
extent: Extent,
params: &[ParamValue],
_rng: &mut u64,
)
fn init( nodes: &mut Nodes<'_, Self>, extent: Extent, params: &[ParamValue], _rng: &mut u64, )
Seeds the lanes and the edges. Read more
Source§fn run_global_pass(
nodes: &mut Nodes<'_, Self>,
params: &TeamParams,
extent: Extent,
rng: &mut u64,
tick: u64,
)
fn run_global_pass( nodes: &mut Nodes<'_, Self>, params: &TeamParams, extent: Extent, rng: &mut u64, tick: u64, )
Runs a sequential pass before the node pass. Read more
Source§fn aux_heap_bytes(aux: &TeamAux) -> usize
fn aux_heap_bytes(aux: &TeamAux) -> usize
Returns the heap memory held by
aux, in bytes. Read moreSource§const ACTIONS: &'static [ActionDescriptor] = _
const ACTIONS: &'static [ActionDescriptor] = _
One-off actions, each shown as a button in the Parameters panel.
Source§const CHUNK: usize = 512
const CHUNK: usize = 512
Number of nodes per chunk in the node pass. Each chunk gets its own RNG stream.
Source§fn directed(_params: &Self::Params) -> bool
fn directed(_params: &Self::Params) -> bool
Returns whether edges are directed. The engine reads it every tick.
Source§fn run_node_pass(
_lanes: &mut Self::Lanes,
_ctx: &NodeCtx<'_, Self>,
_seed: u64,
_tick: u64,
)
fn run_node_pass( _lanes: &mut Self::Lanes, _ctx: &NodeCtx<'_, Self>, _seed: u64, _tick: u64, )
Runs a parallel pass over every slot, including retired ones. Read more
Source§fn act(
_action: usize,
_nodes: &mut Nodes<'_, Self>,
_extent: Extent,
_params: &[ParamValue],
_rng: &mut u64,
)
fn act( _action: usize, _nodes: &mut Nodes<'_, Self>, _extent: Extent, _params: &[ParamValue], _rng: &mut u64, )
Runs entry
action of Self::ACTIONS between ticks, drawing from its own RNG stream.Auto Trait Implementations§
impl Freeze for TeamAssembly
impl RefUnwindSafe for TeamAssembly
impl Send for TeamAssembly
impl Sync for TeamAssembly
impl Unpin for TeamAssembly
impl UnsafeUnpin for TeamAssembly
impl UnwindSafe for TeamAssembly
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more