Commit 3e51d3dd authored by Sonja Happ's avatar Sonja Happ
Browse files

Merge branch 'master' into doc_scenarios

parents 10350f90 82c5f095
variables:
GIT_STRATEGY: clone
GIT_SUBMODULE_STRATEGY: recursive
DOCKER_TAG: ${CI_COMMIT_SHORT_SHA}
DOCKER_TAG: ${CI_COMMIT_BRANCH}
DOCKER_IMAGE: ${CI_REGISTRY_IMAGE}
MAKE_OPTS: -j 4
CMAKE_OPTS: -DWITH_DB=1 -DWITH_VILLAS=1
FF_GITLAB_REGISTRY_HELPER_IMAGE: 1
stages:
- docker
......@@ -19,7 +20,11 @@ docker:ubuntu:
script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"${CI_REGISTRY}\":{\"username\":\"${CI_REGISTRY_USER}\",\"password\":\"${CI_REGISTRY_PASSWORD}\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context ${CI_PROJECT_DIR} --dockerfile ${CI_PROJECT_DIR}/Dockerfile --destination ${DOCKER_IMAGE}:${DOCKER_TAG} --snapshotMode=redo
- /kaniko/executor
--context ${CI_PROJECT_DIR}
--dockerfile ${CI_PROJECT_DIR}/Dockerfile
--destination ${DOCKER_IMAGE}:${DOCKER_TAG}
--snapshotMode=redo
# test stage
test:compile:
......
......@@ -54,7 +54,7 @@ RUN apt-get update && apt-get install -y \
# Install Boost (Dependency of RepastHPC and DistAIX)
RUN cd /tmp && mkdir boost && cd boost && \
wget https://dl.bintray.com/boostorg/release/1.69.0/source/boost_1_69_0.tar.gz && \
wget https://sourceforge.net/projects/boost/files/boost/1.69.0/boost_1_69_0.tar.gz && \
tar xf boost_1_69_0.tar.gz && \
cd boost_1_69_0 && \
./bootstrap.sh --with-libraries=mpi,system,filesystem,serialization && \
......
......@@ -60,6 +60,7 @@ A simulaton is configured with the [model.props](https://git.rwth-aachen.de/acs/
|Parameter | Possible values | Description |
|---------------------------|--------------------------------------|---------------------------------------------------------|
|villas.loglevel |off, error, warning, info, debug |Specify the log level of the VILLASnode library|
|villas.nodetype |String for villas node type |Specify the node type of the VILLASnode (mqtt and nanomsg supported) |
|villas.format |String for villas format type |Specify the format type that is used by the villas interface, e.g. "json". "villas.human" or "csv". Check the docs of villas to get a complete list of available formats|
|villas.mqtt.broker |IP address of MQTT broker |IP adress of MQTT broker, you can use "localhost" if the broker is running on the same machine as DistAIX|
|villas.mqtt.port |Integer of port number |Port number of the MQTT broker|
......
1,Slack,27000
2,Node,2,0,0,27000.0
3,Node,2,0,0,27000.0
4,Node,2,0,0,27000.0
5,Load,COSIM,10,10,1,32000000,0.92
6,Load,COSIM,10,10,1,32000000,0.92
7,Load,COSIM,10,10,1,32000000,0.92
1,2,0,1,5.29,44.965,0.0002772527,0.0,32000000.0,32000000.0
2,3,0,1,5.29,44.965,0.0002772527,0.0,32000000.0,32000000.0
3,4,0,1,5.29,44.965,0.0002772527,0.0,32000000.0,32000000.0
2,5,1,0,0,0,0,0,0,0
3,6,1,0,0,0,0,0,0,0
4,7,1,0,0,0,0,0,0,0
time,P_sfh,Q_sfh,P_mfh1,Q_mfh1,P_mfh2,Q_mfh2,P_office,Q_office,P_store1,Q_store1,P_store2,Q_store2,P_agriculture,Q_agriculture,P_supermarket,Q_supermarket,P_industry,Q_industry
0,259,111,963,411,1853,788,191,82,266,114,380,162,720,307,765,327,57375,24533
3600,188,80,699,297,1344,571,174,74,254,109,380,162,676,287,696,295,52200,22137
7200,160,67,593,253,1140,487,191,82,254,109,398,171,654,279,765,327,57375,24533
10800,148,64,551,235,1060,451,191,82,254,109,371,157,654,279,765,327,57375,24533
14400,148,64,551,235,1060,451,174,74,254,109,362,153,654,279,696,295,52200,22137
18000,148,64,551,235,1060,451,191,82,262,112,426,181,775,330,765,327,57375,24533
21600,168,72,625,266,1202,511,191,82,254,109,500,214,1240,529,765,327,57375,24533
25200,271,115,1007,428,1936,824,174,74,294,126,482,206,2038,868,696,295,52200,22137
28800,451,191,1673,714,3218,1371,174,74,286,122,464,197,2471,1052,696,295,52200,22137
32400,593,253,2203,938,4236,1805,174,74,274,117,537,230,2016,860,696,295,52200,22137
36000,656,279,2436,1037,4684,1996,174,74,286,122,630,269,1640,698,696,295,52200,22137
39600,727,310,2700,1151,5193,2213,191,82,298,127,686,293,1795,765,765,327,57375,24533
43200,681,291,2531,1079,4868,2073,191,82,282,121,658,280,1429,609,765,327,57375,24533
46800,516,220,1917,815,3686,1569,174,74,270,116,566,241,1240,529,696,295,52200,22137
50400,448,190,1663,709,3199,1362,191,82,278,119,546,234,1174,501,765,327,57375,24533
54000,394,167,1462,623,2812,1198,191,82,278,119,557,236,1141,486,765,327,57375,24533
57600,359,154,1335,569,2567,1094,174,74,278,119,537,230,1185,505,696,295,52200,22137
61200,408,173,1514,646,2912,1241,174,74,302,129,593,254,1661,708,696,295,52200,22137
64800,511,216,1896,808,3646,1554,209,89,302,129,557,236,2337,996,835,357,62625,26753
68400,562,239,2087,889,4014,1709,209,89,346,147,491,210,2315,987,835,357,62625,26753
72000,508,216,1886,803,3627,1545,209,89,358,152,445,190,1795,765,835,357,62625,26753
75600,485,206,1801,766,3463,1475,191,82,322,137,426,181,1374,586,765,327,57375,24533
79200,399,170,1483,631,2851,1215,191,82,282,121,389,166,1097,467,765,327,57375,24533
82800,276,119,1027,437,1975,841,191,82,266,114,362,153,865,368,765,327,57375,24533
86400,259,111,963,411,1853,788,191,82,266,114,380,162,720,307,765,327,57375,24533
\ No newline at end of file
time,P_sfh,Q_sfh,P_mfh1,Q_mfh1,P_mfh2,Q_mfh2,P_office,Q_office,P_store1,Q_store1,P_store2,Q_store2,P_agriculture,Q_agriculture,P_supermarket,Q_supermarket,P_industry,Q_industry,P_cosim,Q_cosim
0,259,111,963,411,1853,788,191,82,266,114,380,162,720,307,765,327,57375,24533,30000000,10000000
3600,188,80,699,297,1344,571,174,74,254,109,380,162,676,287,696,295,52200,22137,30000000,10000000
7200,160,67,593,253,1140,487,191,82,254,109,398,171,654,279,765,327,57375,24533,30000000,10000000
10800,148,64,551,235,1060,451,191,82,254,109,371,157,654,279,765,327,57375,24533,30000000,10000000
14400,148,64,551,235,1060,451,174,74,254,109,362,153,654,279,696,295,52200,22137,30000000,10000000
18000,148,64,551,235,1060,451,191,82,262,112,426,181,775,330,765,327,57375,24533,30000000,10000000
21600,168,72,625,266,1202,511,191,82,254,109,500,214,1240,529,765,327,57375,24533,30000000,10000000
25200,271,115,1007,428,1936,824,174,74,294,126,482,206,2038,868,696,295,52200,22137,30000000,10000000
28800,451,191,1673,714,3218,1371,174,74,286,122,464,197,2471,1052,696,295,52200,22137,30000000,10000000
32400,593,253,2203,938,4236,1805,174,74,274,117,537,230,2016,860,696,295,52200,22137,30000000,10000000
36000,656,279,2436,1037,4684,1996,174,74,286,122,630,269,1640,698,696,295,52200,22137,30000000,10000000
39600,727,310,2700,1151,5193,2213,191,82,298,127,686,293,1795,765,765,327,57375,24533,30000000,10000000
43200,681,291,2531,1079,4868,2073,191,82,282,121,658,280,1429,609,765,327,57375,24533,30000000,10000000
46800,516,220,1917,815,3686,1569,174,74,270,116,566,241,1240,529,696,295,52200,22137,30000000,10000000
50400,448,190,1663,709,3199,1362,191,82,278,119,546,234,1174,501,765,327,57375,24533,30000000,10000000
54000,394,167,1462,623,2812,1198,191,82,278,119,557,236,1141,486,765,327,57375,24533,30000000,10000000
57600,359,154,1335,569,2567,1094,174,74,278,119,537,230,1185,505,696,295,52200,22137,30000000,10000000
61200,408,173,1514,646,2912,1241,174,74,302,129,593,254,1661,708,696,295,52200,22137,30000000,10000000
64800,511,216,1896,808,3646,1554,209,89,302,129,557,236,2337,996,835,357,62625,26753,30000000,10000000
68400,562,239,2087,889,4014,1709,209,89,346,147,491,210,2315,987,835,357,62625,26753,30000000,10000000
72000,508,216,1886,803,3627,1545,209,89,358,152,445,190,1795,765,835,357,62625,26753,30000000,10000000
75600,485,206,1801,766,3463,1475,191,82,322,137,426,181,1374,586,765,327,57375,24533,30000000,10000000
79200,399,170,1483,631,2851,1215,191,82,282,121,389,166,1097,467,765,327,57375,24533,30000000,10000000
82800,276,119,1027,437,1975,841,191,82,266,114,362,153,865,368,765,327,57375,24533,30000000,10000000
86400,259,111,963,411,1853,788,191,82,266,114,380,162,720,307,765,327,57375,24533,30000000,10000000
......@@ -42,7 +42,22 @@ public:
std::string &_subtype,
struct data_props _d_props,
villas_node_config *_villas_config,
bool _ict_connected
bool _ict_connected,
bool _realtime = false
);
Slack_agent(repast::AgentId &id,
bool is_local,
double &step_size,
double _Vnom,
double _Vre,
double _Vim,
int &_behavior_type,
int &_model_type,
std::string &_subtype,
struct data_props _d_props,
villas_node_config *_villas_config,
bool _ict_connected,
bool _realtime = false
);
~Slack_agent() override;
......@@ -56,6 +71,9 @@ private:
Slack_data model_data; //!< Model data specific for slack
Slack_data rollback_state; //!< Rollback information of the model; used in FBS
bool get_new_vals; //!< Boolean needed for dpsim_cosim behavior
bool realtime; //!< Boolean needed for realtime cosimulation
void solve();
void solve_steady_state();
void solve_dynamic_phasor();
......
/** Dist2dist_behavior class
/** Dpsim_cosim_behavior class
*
* @author Sonja Happ <sonja.happ@eonerc.rwth-aachen.de>
* @copyright 2019, Institute for Automation of Complex Power Systems, EONERC
......@@ -20,28 +20,28 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************************/
#ifndef DIST2DIST_BEHAVIOR
#define DIST2DIST_BEHAVIOR
#ifndef DPSIM_COSIM_BEHAVIOR
#define DPSIM_COSIM_BEHAVIOR
#include "behavior/agent_behavior.h"
#include "model/nanomsg_message.h"
#include "dpsim_cosim_message.h"
//forwad declarations
struct villas_node_config;
/*! \brief abstract base class for nanomsg test behavior
* */
class Dist2dist_behavior : public Agent_behavior {
class Dpsim_cosim_behavior : public Agent_behavior {
public:
Dist2dist_behavior(int _id, int _type, int _rank, std::string _subtype, double& step_size, struct data_props _d_props,
Dpsim_cosim_behavior(int _id, int _type, int _rank, std::string _subtype, double& step_size, struct data_props _d_props,
villas_node_config * _villas_config);
virtual ~Dist2dist_behavior() override;
virtual ~Dpsim_cosim_behavior() override;
protected:
/* message processing */
void process_incoming_messages();
virtual void process_dist2dist_msg(Nanomsg_msg &msg) = 0;
virtual void process_dpsim_cosim_msg(Dpsim_cosim_msg &msg) = 0;
/* message sending functions */
void send_villas_msg(Villas_message &msg);
......@@ -50,6 +50,9 @@ protected:
/* endpoint creation */
void create_endpoints(villas_node_config * _vnconfig, std::string agent_id);
unsigned int numOfSentMessages = 0;
unsigned int numOfReceivedMessages = 0;
};
#endif //DIST2DIST_BEHAVIOR
\ No newline at end of file
#endif //DPSIM_COSIM_BEHAVIOR
\ No newline at end of file
/** Nanomsg_msg class
/** Dpsim_cosim_msg class
*
* @author Sonja Happ <sonja.happ@eonerc.rwth-aachen.de>
* @copyright 2019, Institute for Automation of Complex Power Systems, EONERC
......@@ -20,33 +20,25 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************************/
#ifndef NANOMSG_MESSAGE
#define NANOMSG_MESSAGE
#ifndef DPSIM_COSIM_MESSAGE
#define DPSIM_COSIM_MESSAGE
#include <complex>
#include "villas_interface/villas_message.h"
class Nanomsg_msg : public Villas_message {
class Dpsim_cosim_msg : public Villas_message {
public:
Nanomsg_msg();
Nanomsg_msg(Villas_message &msg);
Nanomsg_msg( int _sender, int _receiver);
~Nanomsg_msg() override = default;
Dpsim_cosim_msg();
Dpsim_cosim_msg(Villas_message &msg);
~Dpsim_cosim_msg() override = default;
//pointers to elements
int64_t * sender; //!< identity of the sender
int64_t * receiver; //!< identity of the receiver
double * voltage_re; //!< value of voltage_re
double * voltage_im; //!< value of voltage_im
double * current_re; //!< value of current_re
double * current_im; //!< value of current_im
bool * convergence; //!< value of convergence
int64_t * next_action_expected; //!< value of next_action_expected
std::complex<float> * value;
static std::vector<Meta_infos> nanomsg_message_meta;
static std::vector<Meta_infos> dpsim_cosim_message_meta;
static bool meta_initialized;
void set_pointers();
......@@ -55,10 +47,7 @@ public:
std::string get_message_output();
private:
void init_message(int _sender, int _receiver, double _voltage_re, double _voltage_im,
double _current_re, double _current_im, bool _convergence,
int _next_action_expected);
void init_message(std::complex<float> _value);
};
#endif // NANOMSG_MESSAGE
\ No newline at end of file
#endif // DPSIM_COSIM_MESSAGE
\ No newline at end of file
/** Dpsim_cosim_slack_behavior class
*
* @author Sonja Happ <sonja.happ@eonerc.rwth-aachen.de>
* @copyright 2019, Institute for Automation of Complex Power Systems, EONERC
* @license GNU General Public License (version 3)
*
* DistAIX
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************************/
#ifndef DPSIM_COSIM_SLACK_BEHAVIOR
#define DPSIM_COSIM_SLACK_BEHAVIOR
#include "behavior/dpsim_cosim/dpsim_cosim_behavior.h"
/*! \brief Class for nanomsg test slack behavior
* */
class Dpsim_cosim_slack_behavior : public Dpsim_cosim_behavior {
public:
Dpsim_cosim_slack_behavior(int _id, int _type, int _rank, std::string _subtype, double& _step_size, struct data_props _d_props,
villas_node_config * _villas_config, bool _realtime, bool _sync);
~Dpsim_cosim_slack_behavior()= default;
void initialize_agent_behavior(std::vector<std::list<std::tuple<int,int,int>>> * components_at_nodes,
std::vector<std::list<std::tuple<int,int,int>>> * connected_nodes,
boost::multi_array<int, 2> *components_file,
boost::multi_array<std::string, 1> *subtypes_file,
boost::multi_array<int, 2> *el_grid_file) override;
void execute_agent_behavior() override;
void report_to_superior_grid(Dpsim_cosim_msg message, std::list<Villas_message> *incoming_villas_messages);
private:
void receive_msg();
void receive_message(std::list<Villas_message> *incoming_villas_messages);
void synchronize_with_remote();
void process_dpsim_cosim_msg(Dpsim_cosim_msg &msg) override;
int busy_receive_msg(std::list<Villas_message> *incoming_villas_messages);
void send_msg(Dpsim_cosim_msg message);
int sender;
double step_size;
bool first_step = true;
bool realtime;
bool sync;
int timeout = 5000; // timeout for busy waiting in milliseconds
};
#endif // DPSIM_COSIM_SLACK_BEHAVIOR
\ No newline at end of file
/** Dist2dist_slack_behavior class
/** Refic_df_behavior class
*
* @author Sonja Happ <sonja.happ@eonerc.rwth-aachen.de>
* @copyright 2019, Institute for Automation of Complex Power Systems, EONERC
* @author Stefan Dähling <sdaehling@eonerc.rwth-aachen.de>
* @copyright 2020, Institute for Automation of Complex Power Systems, EONERC
* @license GNU General Public License (version 3)
*
* DistAIX
......@@ -20,18 +20,20 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************************/
#ifndef DIST2DIST_SLACK_BEHAVIOR
#define DIST2DIST_SLACK_BEHAVIOR
#ifndef REFIC_DF_BEHAVIOR
#define REFIC_DF_BEHAVIOR
#include "behavior/dist2dist/dist2dist_behavior.h"
#include "behavior/agent_behavior.h"
/*! \brief Class for nanomsg test slack behavior
/*! \brief Class for reference df behavior with internal communication
*
* The DF is not needed in the reference scenario and hence does not do anything
* */
class Dist2dist_slack_behavior : public Dist2dist_behavior {
class Refic_df_behavior : public Agent_behavior {
public:
Dist2dist_slack_behavior(int _id, int _type, int _rank, std::string _subtype, double& step_size, struct data_props _d_props,
villas_node_config * _villas_config);
~Dist2dist_slack_behavior()= default;
Refic_df_behavior(int _id, int _type, std::string _subtype, double& step_size, struct data_props _d_props,
int rank);
~Refic_df_behavior() override;
void initialize_agent_behavior(std::vector<std::list<std::tuple<int,int,int>>> * components_at_nodes,
std::vector<std::list<std::tuple<int,int,int>>> * connected_nodes,
......@@ -39,15 +41,6 @@ public:
boost::multi_array<std::string, 1> *subtypes_file,
boost::multi_array<int, 2> *el_grid_file) override;
void execute_agent_behavior() override;
protected:
void process_dist2dist_msg(Nanomsg_msg &msg) override;
private:
void receive_msg();
void send_msg();
int sender;
};
#endif // DIST2DIST_SLACK_BEHAVIOR
\ No newline at end of file
#endif
/** Refic_prosumer_behavior class
*
* @author Stefan Dähling <sdaehling@eonerc.rwth-aachen.de>
* @copyright 2020, Institute for Automation of Complex Power Systems, EONERC
* @license GNU General Public License (version 3)
*
* DistAIX
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************************/
#ifndef REFIC_PROSUMER_BEHAVIOR
#define REFIC_PROSUMER_BEHAVIOR
#include "behavior/agent_behavior.h"
/*! \brief Class for reference prosumer behavior (battery, biofuel, chp, ev, hp, load, pv, wec) with internal communication
*
* Prosumers in the reference scenario behave according to simple rules. Reactive power is controlled regarding German grid codes.
* */
class Refic_prosumer_behavior : public Agent_behavior {
public:
Refic_prosumer_behavior(int _id, int _type, std::string _subtype, double& step_size, struct data_props _d_props,
Prosumer_data * _prosumer_data);
~Refic_prosumer_behavior() override;
void initialize_agent_behavior(std::vector<std::list<std::tuple<int,int,int>>> * components_at_nodes,
std::vector<std::list<std::tuple<int,int,int>>> * connected_nodes,
boost::multi_array<int, 2> *components_file,
boost::multi_array<std::string, 1> *subtypes_file,
boost::multi_array<int, 2> *el_grid_file) override;
void execute_agent_behavior() override;
private:
void process_incoming_messages();
void query_internal_agents();
void determine_operation_range();
void q_v();
void cosphi_p();
void apply_control_values();
double get_q_available(double p);
std::vector<std::pair<int, double>> internal_agents; //!< id and power of internal agents
double t_last_query; //!< last time internal agents were querried
Prosumer_data * prosumer_data; //!< pointer to prosumer specific datastruct
};
#endif
/** Refic_slack_behavior class
*
* @author Stefan Dähling <sdaehling@eonerc.rwth-aachen.de>
* @copyright 2020, Institute for Automation of Complex Power Systems, EONERC
* @license GNU General Public License (version 3)
*
* DistAIX
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************************/
#ifndef REFIC_SLACK_BEHAVIOR
#define REFIC_SLACK_BEHAVIOR
#include "behavior/agent_behavior.h"
/*! \brief Class for reference slack behavior with internal communication
*
* The slack does not do anything in the reference scenario.
* */
class Refic_slack_behavior : public Agent_behavior {
public:
Refic_slack_behavior(int _id, int _type, std::string _subtype, double& step_size, struct data_props _d_props);
~Refic_slack_behavior() override;
void initialize_agent_behavior(std::vector<std::list<std::tuple<int,int,int>>> * components_at_nodes,
std::vector<std::list<std::tuple<int,int,int>>> * connected_nodes,
boost::multi_array<int, 2> *components_file,
boost::multi_array<std::string, 1> *subtypes_file,
boost::multi_array<int, 2> *el_grid_file) override;
void execute_agent_behavior() override;
};
#endif
/** Nanomsg_test_behavior class
/** Refic_substation_behavior class
*
* @author Sonja Happ <sonja.happ@eonerc.rwth-aachen.de>
* @copyright 2019, Institute for Automation of Complex Power Systems, EONERC
* @author Stefan Dähling <sdaehling@eonerc.rwth-aachen.de>
* @copyright 2020, Institute for Automation of Complex Power Systems, EONERC
* @license GNU General Public License (version 3)
*
* DistAIX
......@@ -20,39 +20,33 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************************/
#ifndef NANOMSG_TEST_BEHAVIOR
#define NANOMSG_TEST_BEHAVIOR
#ifndef REFIC_SUBSTATION_BEHAVIOR
#define REFIC_SUBSTATION_BEHAVIOR
#include "behavior/agent_behavior.h"
#include "model/nanomsg_message.h"
//forwad declarations
struct villas_node_config;
/*! \brief abstract base class for nanomsg test behavior
/*! \brief Class for reference substation behavior with internal communication
*
* The substaion only controls the tap changer in the reference scenario. This is done
* considering only the voltage at the secondary node.
* */
class Nanomsg_test_behavior : public Agent_behavior {
class Refic_substation_behavior : public Agent_behavior {
public:
Nanomsg_test_behavior(int _id, int _type, int _rank, std::string _subtype, double& step_size, struct data_props _d_props,
villas_node_config * _villas_config);
virtual ~Nanomsg_test_behavior() override;
void execute_agent_behavior() override;
Refic_substation_behavior(int _id, int _type, std::string _subtype, double& step_size, struct data_props _d_props,
Substation_data * _substation_data);
~Refic_substation_behavior() override;
void initialize_agent_behavior(std::vector<std::list<std::tuple<int,int,int>>> * components_at_nodes,
std::vector<std::list<std::tuple<int,int,int>>> * connected_nodes,
boost::multi_array<int, 2> *components_file,
boost::multi_array<std::string, 1> *subtypes_file,
boost::multi_array<int, 2> *el_grid_file) override;
void execute_agent_behavior() override;
protected:
/* message processing */
void process_incoming_messages();
/* message sending functions */
void send_villas_msg(Villas_message &msg);
struct villas_node_config * vnconfig;
private:
void apply_control_values();
/* endpoint creation */
void create_endpoints(villas_node_config * _vnconfig, std::string agent_id);
Substation_data * substation_data; //!< pointer to equipment specific datastruct
};
#endif //NANOMSG_TEST_BEHAVIOR
\ No newline at end of file
#endif
......@@ -45,6 +45,7 @@ public:
private:
void determine_operation_range();
void q_v();
void apply_control_values();
double get_q_available(double p);
......
/** Swarm_dpsim_cosim_slack_behavior class
*
* @author Sonja Happ <sonja.happ@eonerc.rwth-aachen.de>
* @copyright 2019, Institute for Automation of Complex Power Systems, EONERC
* @license GNU General Public License (version 3)
*
* DistAIX
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************************/
#ifndef SWARM_DPSIM_COSIM_SLACK_BEHAVIOR
#define SWARM_DPSIM_COSIM_SLACK_BEHAVIOR
#include "behavior/swarmgrid/swarm_slack_behavior.h"
#include "behavior/dpsim_cosim/dpsim_cosim_message.h"
//forwad declarations