# Simulation with AnyLogic/Discrete Event Simulation/Ophthalmology Department Model/Step 4. Defining the network and resources
## Step 4. Defining the Network and Resources

Now we will add objects describing the network and resources available in it.
Define the model network
* Add Network object onto the diagram. To add a object of the library on the diagram, first open the library palette (Enterprise Library stencil of the Palette view), then click on the object in the library stencil and finally, click in the graphical editor where you want to place the object.
* Network object defines the network. Please refer to Enterprise Library Reference Guide for the description of all the Enterprise Library objects. You can find there all object functions and their parameters. To open Enterprise Library Reference Guide, choose the corresponding item from the AnyLogic Help. To open Help window, choose Help|Help Contents from AnyLogic menu.
* Set the object properties. Specify the group containing shapes standing for network nodes and links. Thus we associate the defined network structure with this Network object. Choose networkGroup as the Group of network shapes:
Now we will add library objects defining pools of network resources. The resources may be of three types: moving, portable and static. In our example, doctors are moving resources, scopes are portable resources, and procedure rooms are the static ones.
Define doctor resources pool
* Add NetworkResourcePool object on the diagram. NetworkResourcePool describes resources of a particular type. This one will describe doctor resources. Set the following object properties:
* Name the object doctor.
* Specify the number of resource units in the Capacity edit box: 5.
* Specify the home location of the resource. Moving resource unit returns there if it gets idle. In our model doctors spare one private office space, so we leave the default value of the Home defined by property (Single node) unchanged.
* Type staffRooom (the name of the rectangle representing the staffroom) in the Home node edit box.
* Set shapeDoctor as Idle unit animation shape and Busy unit animation shape.
Define procedure room resources pool
* Add one more NetworkResourcePool object to describe procedure room resources. Set the following object properties:
* Name the object procRoom.
* Change the Resource type to Static.
* A static resource always resides at its home location. There can be a number of resource home locations. In this case you need to draw a polyline with points lying in the corresponding rectangles and specify it as the object’s Home path. We have three procedure rooms in our model, so we should use this approach.
* Choose Path across nodes in the Home defined by property.
* In the Home path edit box, specify roomsLocation polyline created beforehand for this purpose.
* Specify that the resource object has the number of resource units equal to the number of points of the specified polyline. Therefore, choose By home shape option in the Capacity defined property.
Define scope resources pool
* In the same way, add NetworkResourcePool object to describe ophthalmoscope resources. Set the following object properties:
* Name the object scope.
* Change the Resource type to Portable.
* Specify the number of resource units in the Capacity edit box: 5.
* Specify the home location of the resource. Portable resource unit are placed there at the model startup. Leave the default value of the Home defined by property (Single node) unchanged.
* Type storageRooom (the name of the rectangle representing the storage room) in the Home node edit box.
* Set shapeScope as Idle unit animation shape and Busy unit animation shape.
Connect NetworkResourcePool objects with Network
* To add the defined resources into the network, you should connect ports of NetworkResourcePool objects with the port of the Network object. Connect them as shown in the figure:
* To connect ports of objects, double-click the first port, then optionally click at each connector's turning point on the diagram, and finally click the second port. The connector linking two ports appears.
* Cyan points inside ports indicate the correct connection. In the case you do not see cyan circles, it probably means that you put connector's point close by a port and you need to move it onto it.