#include <simgrid/platf_generator.h>
#include "platf_generator_private.h"
#include <xbt.h>
-#include <xbt/graph.h>
#include <xbt/RngStream.h>
static xbt_graph_t platform_graph = NULL;
void platf_graph_init(int node_count) {
int i;
- platform_graph = xbt_graph_new_graph(TRUE, NULL);
+ platform_graph = xbt_graph_new_graph(FALSE, NULL);
if(rng_stream == NULL) {
rng_stream = RngStream_CreateStream(NULL);
}
}
}
+void platf_node_connect(xbt_node_t node1, xbt_node_t node2) {
+ context_node_t node1_data;
+ context_node_t node2_data;
+ node1_data = (context_node_t) xbt_graph_node_get_data(node1);
+ node2_data = (context_node_t) xbt_graph_node_get_data(node2);
+ node1_data->degree++;
+ node2_data->degree++;
+ xbt_graph_new_edge(platform_graph, node1, node2, NULL);
+}
+
void platf_graph_uniform(int node_count) {
xbt_dynar_t dynar_nodes = NULL;
xbt_node_t graph_node = NULL;
node_data->y = RngStream_RandU01(rng_stream);
}
}
+
+void platf_graph_interconnect_star(void) {
+
+ xbt_dynar_t dynar_nodes = NULL;
+ xbt_node_t graph_node = NULL;
+ xbt_node_t first_node = NULL;
+ unsigned int i;
+
+ dynar_nodes = xbt_graph_get_nodes(platform_graph);
+ xbt_dynar_foreach(dynar_nodes, i, graph_node) {
+ if(i==0) {
+ //Ok, we get the first node, let's keep it somewhere...
+ first_node = graph_node;
+ } else {
+ //All the other nodes are connected to the first one
+ platf_node_connect(graph_node, first_node);
+ }
+ }
+}