Class DefaultNodeCreator

  • All Implemented Interfaces:
    NodeCreator

    public class DefaultNodeCreator
    extends Object
    implements NodeCreator
    Creates an agent / node from a Class. If the Class has a constructor with a single String parameter, the label will be passed in the Constructor.
    Author:
    Nick Collier
    • Constructor Detail

      • DefaultNodeCreator

        public DefaultNodeCreator​(Class nodeClass)
        Creates a DefaultNodeCreator that will create nodes/agents from the specified class.
        Parameters:
        nodeClass - the class of the agents /nodes to create
    • Method Detail

      • createNode

        public Object createNode​(String label)
        Creates and returns a node to be added to a network via a context.
        Specified by:
        createNode in interface NodeCreator
        Parameters:
        label - the node label. If the node label does not exist this will be an empty string
        Returns:
        the created Node.