@Override public void putData(String sector, SectorDataset sectorDataset) { final int t = timer.getPeriod().intValue(); if (!this.macroDataset.containsKey(t)) { this.macroDataset.put(t, new HashMap<String, SectorDataset>()); this.macroDataset.remove(t - (1 + this.maxLag)); } final Map<String, SectorDataset> sectors = this.macroDataset.get(t); sectors.put(sector, sectorDataset); }
@Override public String getMessage(String sector, String agent, String key, int lag) { final String result; final int t = timer.getPeriod().intValue() - lag; final SectorDataset sectorDataset = getSectorDataset(sector, t); if (sectorDataset != null) { result = sectorDataset.getAgentInfo(agent, key); } else { result = null; // TODO générer une erreur ? } return result; }