##
Pandora

Class Model

- public class
**Model**

This class is a base class for all the models ( algorithms ) that a user will want to implement. Any class that is designed to be a network - topology generating algorithm **has to extend this class.**

The user that wants to implement his/her own algorithm has to write code for what happens when a new node comes in the graph ( that is in the method addNode.

In the source code of the pandora generator one can find many examples of network - topology genarating algorithms.

**Version:**- 0.1
**Author:**- Foudalis Ilias

### Model

public **Model**()

- Class constructor.

### Model

public **Model**(java.lang.String name)

- Class constructor.

**Parameters:**`name`

- String : The name of the model. Recomended to use this constructor.

### getNodes

public java.util.Vector **getNodes**()

- Returns a vector containing the nodes that have been generated by the algorithm.

**Returns:**- Vector : the nodes in the Vector are of type GraphNode

### getEdges

public java.util.Vector **getEdges**()

- returns a vector that contains the edges that have been generated by the algorithm.

**Returns:**- Vector : the edges in the Vector are of type GraphEdge

### showOptWindow

public void **showOptWindow**()

- Initializes and shows the window containing the variables of the graph.

### updateModelVars

public void **updateModelVars**()

- When the window containing the variables is closed, this method is responsible for updating the model variables.

### reset

public void **reset**()

- Resets all the progress that the algorithm has made in constructing the graph.

### getMaxDegree

public int **getMaxDegree**()

- Returns the max degree of the graph.

**Returns:**- int : The max degree of the graph.

### createVertex

public Pandora.GraphNode **createVertex**(int i)

- Creates a GraphNode object.

**Parameters:**`i`

- int : the creation order of the GraphNode.
**Returns:**- GraphNode

### addNode

public void **addNode**(int i)

- This method is implemented by the user that wishes to make a new algorithm. This method is used to connect a node to the graph. Again the user is encouraged to look at the many examples of the algorithms that are in the source code of pandora generator to understand how to implement an algorithm.

**Parameters:**`i`

- int : the creation order of the node.