@Override public void writeData(Chromosome result, Map<String, OutputVariable<?>> data) { for(OutputVariable<?> var : data.values()) { if (System.out!=null) { System.out.println(var.getName()+": "+var.getValue()); } } }
public void setOutputVariable(OutputVariable<?> variable) { /** * if the output variable is contained in sequenceOutputVariableFactories, * then it must be a DirectSequenceOutputVariableFactory, hence we set its * value so that it can be used to produce the next timeline variable. */ if (sequenceOutputVariableFactories.containsKey(variable.getName())) { if(variable.getValue() instanceof Integer) { DirectSequenceOutputVariableFactory<Integer> v = (DirectSequenceOutputVariableFactory<Integer>) sequenceOutputVariableFactories.get(variable.getName()); v.setValue((Integer) variable.getValue()); } else if(variable.getValue() instanceof Double) { DirectSequenceOutputVariableFactory<Double> v = (DirectSequenceOutputVariableFactory<Double>) sequenceOutputVariableFactories.get(variable.getName()); v.setValue((Double) variable.getValue()); } // v.setValue((Integer)variable.getValue()); } else outputVariables.put(variable.getName(), variable); }
/** * Process status update event received from client */ @Override public void receiveEvent(ClientStateInformation information) { if(information.getState() != currentState) { logger.info("Received status update: "+information); if(information.getState() == ClientState.SEARCH) { searchStartTime = System.currentTimeMillis(); for(SequenceOutputVariableFactory<?> factory : sequenceOutputVariableFactories.values()) { factory.setStartTime(searchStartTime); } } OutputVariable<Long> time = new OutputVariable<Long>("Time_"+currentState.getName(), System.currentTimeMillis() - currentStateStarted); outputVariables.put(time.getName(), time); currentState = information.getState(); currentStateStarted = System.currentTimeMillis(); } }
variables.put(var.getName(), var);