private synchronized void computeLoadInfo() {
// initialize the set
loadInfos = new HashMap<Device,LoadInfo>();
DecoratorsFactory decFactory = activityInfo.getDecFactory();
// compute loads
for (Action action : path) {
try {
ActionDecorator actionDec = (ActionDecorator) decFactory.getDecorator(action);
PaStepStub paStub = actionDec.getPaStepStub();
// parse load string
String hostDemandRep = paStub.getHostDemand();
if (hostDemandRep == null) hostDemandRep = "";
Map<RESOURCE_TYPE,Double> demands = LoadInfo.parseDemandString(hostDemandRep);
Artifact artifact = actionDec.getImplementingArtifact();
if (artifact != null) { // update loads
ArtifactDecorator artifactDec = (ArtifactDecorator) decFactory.getDecorator(artifact);
LoadInfo loadInfo = loadInfos.get(artifactDec.getDeploymentDevice());
if (loadInfo == null) {
loadInfo = new LoadInfo(artifactDec.getDeploymentDevice());
loadInfos.put(loadInfo.getTargetDevice(), loadInfo);