Commit a45bf390 authored by Steffen Lackner's avatar Steffen Lackner
Browse files

[code] Send configuration of time sharing to scheduler

parent d7bf6725
...@@ -46,6 +46,7 @@ void JsonProtocolWriter::append_requested_call(double date) ...@@ -46,6 +46,7 @@ void JsonProtocolWriter::append_requested_call(double date)
void JsonProtocolWriter::append_simulation_begins(Machines & machines, void JsonProtocolWriter::append_simulation_begins(Machines & machines,
const Document & configuration, const Document & configuration,
bool allow_time_sharing,
double date) double date)
{ {
/* { /* {
...@@ -63,6 +64,7 @@ void JsonProtocolWriter::append_simulation_begins(Machines & machines, ...@@ -63,6 +64,7 @@ void JsonProtocolWriter::append_simulation_begins(Machines & machines,
Value data(rapidjson::kObjectType); Value data(rapidjson::kObjectType);
data.AddMember("nb_resources", Value().SetInt(machines.nb_machines()), _alloc); data.AddMember("nb_resources", Value().SetInt(machines.nb_machines()), _alloc);
data.AddMember("allow_time_sharing", Value().SetBool(allow_time_sharing), _alloc);
data.AddMember("config", config, _alloc); data.AddMember("config", config, _alloc);
Value resources(rapidjson::kArrayType); Value resources(rapidjson::kArrayType);
......
...@@ -78,6 +78,7 @@ public: ...@@ -78,6 +78,7 @@ public:
*/ */
virtual void append_simulation_begins(Machines & machines, virtual void append_simulation_begins(Machines & machines,
const rapidjson::Document & configuration, const rapidjson::Document & configuration,
bool allow_time_sharing,
double date) = 0; double date) = 0;
/** /**
...@@ -196,6 +197,7 @@ public: ...@@ -196,6 +197,7 @@ public:
*/ */
void append_simulation_begins(Machines & machines, void append_simulation_begins(Machines & machines,
const rapidjson::Document & configuration, const rapidjson::Document & configuration,
bool allow_time_sharing,
double date); double date);
/** /**
......
...@@ -34,7 +34,9 @@ int server_process(int argc, char *argv[]) ...@@ -34,7 +34,9 @@ int server_process(int argc, char *argv[])
// Let's tell the Decision process that the simulation is about to begin // Let's tell the Decision process that the simulation is about to begin
// (and that some data can be read from the data storage) // (and that some data can be read from the data storage)
context->proto_writer->append_simulation_begins(context->machines, context->proto_writer->append_simulation_begins(context->machines,
context->config_file, MSG_get_clock()); context->config_file,
context->allow_time_sharing,
MSG_get_clock());
RequestReplyProcessArguments * req_rep_args = new RequestReplyProcessArguments; RequestReplyProcessArguments * req_rep_args = new RequestReplyProcessArguments;
req_rep_args->context = context; req_rep_args->context = context;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment