' +
'
' + experiment.name + '
' +
'
' + this.getPathNameById(experiment.pathId) + '
' +
'
' + experiment.trace.name + '
' +
'
' + experiment.schedulerName + '
' +
'
' +
'
'
);
});
}
}
private getPathNameById(id: number): string {
for (let i = 0; i < this.simulation.paths.length; i++) {
if (id === this.simulation.paths[i].id) {
return SimulationController.getPathName(this.simulation.paths[i]);
}
}
}
private getPathById(id: number): IPath {
for (let i = 0; i < this.simulation.paths.length; i++) {
if (id === this.simulation.paths[i].id) {
return this.simulation.paths[i];
}
}
}
private static getPathName(path: IPath): string {
if (path.name === null) {
return "Path " + path.id;
} else {
return path.name;
}
}
private setColors() {
if (this.mapController.appMode === AppMode.SIMULATION) {
if (this.mapController.interactionLevel === InteractionLevel.BUILDING) {
this.mapView.roomLayer.intensityLevels = {};
this.stateCache.stateList[this.currentTick].roomStates.forEach((roomState: IRoomState) => {
if (this.colorRepresentation === ColorRepresentation.LOAD) {
this.mapView.roomLayer.intensityLevels[roomState.roomId] =
Util.determineLoadIntensityLevel(roomState.loadFraction);
}
});
this.mapView.roomLayer.draw();
this.mapView.dcObjectLayer.draw();
} else if (this.mapController.interactionLevel === InteractionLevel.ROOM ||
this.mapController.interactionLevel === InteractionLevel.OBJECT) {
this.mapView.dcObjectLayer.intensityLevels = {};
this.stateCache.stateList[this.currentTick].rackStates.forEach((rackState: IRackState) => {
if (this.colorRepresentation === ColorRepresentation.LOAD) {
this.mapView.dcObjectLayer.intensityLevels[rackState.rackId] =
Util.determineLoadIntensityLevel(rackState.loadFraction);
}
});
this.mapView.roomLayer.draw();
this.mapView.dcObjectLayer.draw();
}
if (this.mapController.interactionLevel === InteractionLevel.OBJECT ||
this.mapController.interactionLevel === InteractionLevel.NODE) {
this.stateCache.stateList[this.currentTick].machineStates.forEach((machineState: IMachineState) => {
let element = $('.node-element[data-id="' + machineState.machineId + '"] .node-element-content');
element.css("background-color", Util.convertIntensityToColor(
Util.determineLoadIntensityLevel(machineState.loadFraction)
));
// Color all transparent icon overlays, as well
element = $('.node-element[data-id="' + machineState.machineId + '"] .icon-overlay');
element.css("background-color", Util.convertIntensityToColor(
Util.determineLoadIntensityLevel(machineState.loadFraction)
));
});
}
} else {
this.mapView.roomLayer.coloringMode = false;
this.mapView.dcObjectLayer.coloringMode = false;
this.mapView.roomLayer.draw();
this.mapView.dcObjectLayer.draw();
}
}
/**
* Populates the building simulation menu with dynamic statistics concerning the state of all rooms in the building.
*/
private updateBuildingStats(): void {
if (this.mapController.interactionLevel !== InteractionLevel.BUILDING) {
return;
}
const container = $(".building-stats-list");
container.children().remove("div");
this.stateCache.stateList[this.currentTick].roomStates.forEach((roomState: IRoomState) => {
if (this.colorRepresentation === ColorRepresentation.LOAD && roomState.room !== undefined) {
const html = '