Wiki
Clone wikiExperimentTool / C1 Payoff Calculation
-
Please refer to edu.kit.exp.server.gui.mainframe.PayoffDialog class.
-
In your experiments, you can set the subject’s payoff using
#!java Subject subject = new Subject(); subject.setPayoff(new Double (5.0));
- Update the Payoff variable for each iteration of your experiment:
#!java subject.setPayoff(new Double(subject.getPayoff() + 5.0 );
#!java public void calc() { List<Subject> list = null; try { list = guiController.getSubjects(); } catch (DataInputException e) { JOptionPane.showMessageDialog(MainFrame.getInstance(), e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE); } catch (StructureManagementException e) { JOptionPane.showMessageDialog(MainFrame.getInstance(), e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE); } for (Subject subject : list) { String line = ""; Double fac = Double.valueOf(textFieldFactor.getText()); Double payOff = subject.getPayoff(); Double product = payOff * fac; line += subject.getIdClient() + ", (" + payOff + ") : " + product.toString() + " Euro" + System.lineSeparator(); textArea.append(line); } }
Updated