* @param ratio ratio of permits in total permits for this type. 0 <= ratio <= 1.
*/
public Semaphore addType(int type, double ratio) {
Semaphore permits = new Semaphore((int) (m_totalPermits * ratio));
m_permits.put(type, permits);
m_initialPermits.put(type, permits.availablePermits());
return permits;
}
public void resetPermits() {
for (Entry<Integer, Semaphore> e : m_permits.entrySet()) {