GraphNodeAttribute | index ../../../../piana/code/Graph/GraphNodeAttribute.py |
File : GraphNodeAttribute.py
Author : Daniel Jaeggi and Ramon Aragues
Creation : 2003
Contents : class NodeAttribute
=======================================================================================================
Skeleton attribute classes for nodes in a graph.
nodes in a graph are just abstract containers and only have
"real world" meanings by containing attributes. For each particular
problem, custon edge and node attributes must be defined.
For example, we may be modeling the network formed by Hollywood actors.
Actors form the nodes and films in which both actors have starred form
the edges. We could then define custom node attributes thus:
class Actor(NodeAttribute):
# class defining an movie actor
def __init__(self, name, n_oscars=0, speciality='hollywood_blockbusters'):
self.name = name
self.n_oscars = int(n_oscars)
self.speciality = speciality
Attributes in this way can be arbitrarily complex
Classes | ||||||||||
|