public EventDone performEvent(SimulationEvent reaction) {
        
        if ( reaction instanceof SIREventWithRate) {
            SIREventWithRate event = ((SIREventWithRate) reaction);
            
            Agent fromAgent             = event.getFromAgent();
            Agent toAgent               = event.getToAgent();
            SIREventType    etype       = event.getEventType();
            
            EventDone ev = new EventDone();
            ev.setEventType(etype);
            
            if (fromAgent ==  null) {
                // choose an appropriate from agent
                fromAgent = getAgentWithState( event.getFromAgentState() );
            }
            
            ev.setFromAgent(fromAgent);
            ev.setFromState( event.getFromAgentState() );
            
            if (etype.equals(SIREventType.EXPOSURE) || (etype.equals(SIREventType.INFECTION))) {
                // from and to agent should be different
                
                if (toAgent == null) {
                    // choose an appropriate to agent
                    // this will always be susceptible
                    toAgent = getAgentWithState( IndividualStateType.SUSCEPTIBLE );
                }
                updateAgent(toAgent, IndividualStateType.SUSCEPTIBLE, event.getToAgentState() );
                
                ev.setToAgent( toAgent );
                ev.setToState( event.getToAgentState() );
                
            } else {
                // from and to agents are the same
                updateAgent(fromAgent, event.getFromAgentState(), event.getToAgentState());
                
                ev.setToAgent( fromAgent );
                ev.setToState( event.getToAgentState() );
            }
            
            return ev;
            
        } else {
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        }
        
    }