function esn = create_esn(nInputs, nResUnits, nOutputs, connectivity, srScaling)

%%%% set the number of units
esn.nInputs = nInputs; 
esn.nResUnits = nResUnits; 
esn.nOutputs = nOutputs; 

nAllUnits = nResUnits + nOutputs;

esn.nAllUnits = nAllUnits;

%esn.resWeights = createReservoir(nResUnits, connectivity);
esn.resWeights = generate_internal_weights(nResUnits, connectivity / 100);

esn.resWeights = esn.resWeights * srScaling;

%2.0 * rand(nResUnits, nInputs)- 1.0;

% input weight matrix has weight vectors per input unit in colums
esn.inWeights = 2 * rand(nResUnits, nInputs) - 1;
%esn.inWeights = 0.5 * (sprand(nResUnits, nInputs, 0.2) - 0.5);

% output weight matrix has weights for output units in rows

esn.outWeights = 2 * rand(nOutputs, nInputs + nResUnits) - 1;

%output feedback weight matrix
esn.feedbackWeights = 2 * rand(nResUnits, nOutputs) - 1;

esn.y = zeros(1, nOutputs)'; %2.0 * rand(1, nOutputs)' - 1;
esn.x = rand(1, nResUnits)' - 0.5; %zeros(1, nResUnits)';  %



