run method

void run()

Implementation

void run() {
  for (var i = 0; i < duration; i++) {
    print('Starting round: $i');
    _ledger = env.newRoundCallback(ledger, i);

    //print(ledger.contract);

    players.forEach((_) {
      // It's a one length or empty  list
      final txs = _.newRoundCallback(ledger, i);
      if (txs.isNotEmpty) {
        try {
          ledger.addTransaction(txs.first);
          print('Transaction applied: ${txs.toString()}');
        } catch (exception) {
          print('Transaction rejected: ${txs.toString()}');
        }
      }
    });

    print('Ending round: $i');
    //print(ledger.contract);
  }

  print('End of simulation. ${ledger.contract}');
}