This thesis analyzes an example of a resource allocating fluid queuing system. Fluid queuing models are widely used these days in describing the performance of network switches, routers and so on. Some works focus on the description of fluid queue in terms of probability. However, in this thesis, we focus on finding the optimal control policy using simulation. Stochastic differential equations play an important role in the problem formulation and simulation. We prove that strict mathematical expression of optimal control is hard to come up with when the controller is part of the stochastic differential equation. Thus, simulation is used to find optimal control for an example system, which is defined in the thesis.