|
|
The Node and Model Interfaces The Node interface represents a node in the map.
Each node has both a model and an underlying pattern.
The pattern of the node represents the node’s position in the map. Likewise, the Model interface represents a model of a node.
Each model has both a corresponding node and an underlying pattern.
The pattern of a model is of the same type as the data patterns, since
that is what it is modeling.
Figure 1. UML diagram for the Node and Model interfaces. Unlike Pattern implementations, Node and Model implementations are meant to be mutable. That is, there are set methods for the Node/Model and the Pattern in both interfaces. Because the SOM algorithm is constantly changing the pattern of the models, the setPattern method makes it easy to change the pattern of the model. Even though making Node and Model implementations mutable requires some extra logic in the implementation classes, performance is increased by not having to create a new Node and Model instance every time a model's pattern is updated. JSOMap provides skeletal implementations of the Node and Model interfaces, called AbstractNode and AbstractModel. AbstractNode provides the support for storing the node's model, and AbstractModel provides the support for storing the model's node. Additionally, there are vector implementations of the Node and Model interfaces. DoubleNode and DoubleModel both use a DoublePattern while IntegerNode and IntegerModel both use an IntegerPattern. Figure 2. UML diagram for the Node and Model implementations. The DoubleNode and IntegerNode classes are useful for representing the nodes of a traditional map, that is where nodes are points in 1-D or 2-D space (these classes can also represent nodes in arbitrary n-D space). Since the models of the map are modeling the data patterns, any new concrete implementation of Pattern should also have a corresponding implementation of Model. This new Model implementation can extend from AbstractModel and is just responsible for storing a reference to an object of the new Pattern type.
|
Send mail to zcox@iastate.edu with
questions or comments about this web site.
|