Skip to main content

TeamAssembly

Struct TeamAssembly 

Source
pub struct TeamAssembly;
Expand description

Team Assembly as a NetworkModel.

Trait Implementations§

Source§

impl Debug for TeamAssembly

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl NetworkModel for TeamAssembly

Source§

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>

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 NAME: &'static str = "Team Assembly"

Name shown in the UI.
Source§

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."

One-line description shown in the UI.
Source§

const PALETTE: &'static [[u8; 4]]

Node colours, indexed by the colour lane.
Source§

const EDGE_PALETTE: &'static [[u8; 4]]

Edge colours, indexed by each edge’s colour byte.
Source§

const STATS: &'static [StatDescriptor]

Stat series shown in the history chart.
Source§

const DEFAULT_NODES: u32 = 4

Default of num_agents, the node count.
Source§

const DEFAULT_EXTENT: Extent

World the layout spreads nodes over. It is used for drawing only.
Source§

const LAYOUT: SpringParams

Constants of the spring layout.
Source§

type Lanes = TeamLanes

Node lanes, declared with agent_lanes!.
Source§

type Params = TeamParams

Hot parameters, extracted once per tick.
Source§

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>

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

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, )

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, )

Runs a sequential pass before the node pass. Read more
Source§

fn aux_heap_bytes(aux: &TeamAux) -> usize

Returns the heap memory held by aux, in bytes. Read more
Source§

const ACTIONS: &'static [ActionDescriptor] = _

One-off actions, each shown as a button in the Parameters panel.
Source§

const CHUNK: usize = 512

Number of nodes per chunk in the node pass. Each chunk gets its own RNG stream.
Source§

const MAX_NODES: u32 = 10_000_000

Upper bound of num_agents.
Source§

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, )

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, )

Runs entry action of Self::ACTIONS between ticks, drawing from its own RNG stream.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,

Source§

impl<T> WasmNotSync for T
where T: Sync,