question: public void preAllocateSynapses ( int expectedNumSynapses ) throws IllegalStateException { if ( ! exSynapseSet . isEmpty ( ) || ! inSynapseSet . isEmpty ( ) ) { throw new IllegalArgumentException ( "Cannot pre-allocate space" + " for some expected number of synapses when the synapse" + " when one or both synapse sets are already populated." + " Pre-allocations can only occur before connections" + " have been initialized." ) ; } exSynapseSet = new HashSet < Synapse > ( ( int ) ( expectedNumSynapses * excitatoryRatio / 0.8 ) ) ; inSynapseSet = new HashSet < Synapse > ( ( int ) ( expectedNumSynapses * ( 1 - excitatoryRatio ) / 0.8 ) ) ; }
target:  Pre-allocates, that is sets the initial capacity of the arraylist containing this synapse group's synapses. This allows expectedNumber of synapses to be added to this synapse group without the synapse list having to perform any operations related to expanding the list size.