protected double wiringProbability = 0.05;
public void generate(ContainerLoader container) {
Random random = new Random();
AttributeColumn col = container.getAttributeModel().getNodeTable().addColumn("score", AttributeType.DYNAMIC_INT);
NodeDraft[] nodeArray = new NodeDraft[numberOfNodes];
for (int i = 0; i < numberOfNodes; i++) {
NodeDraft nodeDraft = container.factory().newNodeDraft();
nodeDraft.setId("n" + i);
container.addNode(nodeDraft);
Random r = new Random();
int randomStart = r.nextInt(10) + 2000;
int randomEnd = randomStart + 20 + r.nextInt(10);
nodeDraft.addTimeInterval("" + randomStart, "" + randomEnd);
randomEnd = randomStart + r.nextInt(10);
nodeDraft.addAttributeValue(col, r.nextInt(5), "" + randomStart, "" + randomEnd);
randomStart = randomEnd + 1;
randomEnd = randomStart + r.nextInt(10);
nodeDraft.addAttributeValue(col, r.nextInt(5), "" + randomStart, "" + randomEnd);
nodeArray[i] = nodeDraft;
}
if (wiringProbability > 0) {
AttributeColumn oldWeight = container.getAttributeModel().getEdgeTable().getColumn(PropertiesColumn.EDGE_WEIGHT.getIndex());
AttributeColumn weightCol = container.getAttributeModel().getEdgeTable().replaceColumn(oldWeight, PropertiesColumn.EDGE_WEIGHT.getId(), PropertiesColumn.EDGE_WEIGHT.getTitle(), AttributeType.DYNAMIC_FLOAT, AttributeOrigin.PROPERTY, null);
for (int i = 0; i < numberOfNodes - 1; i++) {
NodeDraft node1 = nodeArray[i];
for (int j = i + 1; j < numberOfNodes; j++) {
NodeDraft node2 = nodeArray[j];