Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuleSet into (ActiveRuleSet, RuleSet) based on their responsibility #336

Merged
merged 89 commits into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from 88 commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
a925c72
add test for active ruleset
Chibikuri Dec 28, 2021
3a04648
fillout active ruleset
Chibikuri Dec 28, 2021
cf5b083
add WIP test for reconstructing ActiveRuleSet from RuleSet
Chibikuri Jan 3, 2022
87fd4d7
add tests for inactive ruleset and active ruleset constructor
Chibikuri Jan 3, 2022
c80e434
add blank test for ruleset
Chibikuri Jan 6, 2022
6d38b92
empty commit for active ruleset dev branch
Chibikuri Jan 6, 2022
8c028e8
update ruleset tests
Chibikuri Jan 6, 2022
bbff712
replace current ruleset and rules with active ruleset and active rules
Chibikuri Jan 6, 2022
8bb0b18
cleaned up comments
Chibikuri Jan 7, 2022
2ffcf7b
Merge pull request #335 from sfc-aqua/active_ruleset
Chibikuri Jan 7, 2022
37484d7
replace current actions and conditions with active actions and active…
Chibikuri Jan 8, 2022
ce546ce
create new namespace active and fixed all dependencies
Chibikuri Jan 9, 2022
42dd148
cleanup namespace definition
Chibikuri Jan 9, 2022
0526d09
Merge pull request #340 from sfc-aqua/static_ruleset
Chibikuri Jan 9, 2022
1c381b6
Merge branch 'master' of github.com:sfc-aqua/quisp into active_rulese…
Chibikuri Jan 9, 2022
403a9dd
filled addRule
Chibikuri Jan 9, 2022
1f437be
applied format
Chibikuri Jan 9, 2022
8b64e22
fixed addRule
Chibikuri Jan 9, 2022
d41f6ac
add parent_ruleset_id and some tests
Chibikuri Jan 10, 2022
ad38b69
Merge pull request #341 from sfc-aqua/inactive_rule_test
Chibikuri Jan 10, 2022
8d6d9b4
Merge branch 'master' of github.com:sfc-aqua/quisp into active_rulese…
Chibikuri Jan 10, 2022
f0dc600
implemented setNextRule
Chibikuri Jan 10, 2022
d93b025
modified Rule structure
Chibikuri Jan 24, 2022
1020164
Merge branch 'master' of github.com:sfc-aqua/quisp into active_rulese…
Chibikuri Jan 24, 2022
04212e8
add different actions
Chibikuri Jan 24, 2022
03c1260
add clauses
Chibikuri Jan 24, 2022
9fa3667
Merge branch 'master' of github.com:sfc-aqua/quisp into active_rulese…
Chibikuri Jan 25, 2022
69167ba
fixed add rule and include
Chibikuri Jan 26, 2022
8f8c1ad
Merge pull request #363 from sfc-aqua/rule_implementation
Chibikuri Jan 26, 2022
c9b15af
add json submodule
Chibikuri Jan 26, 2022
c5524c2
add serialization functions
Chibikuri Jan 28, 2022
bbcfa7d
change the way to add json
Chibikuri Jan 29, 2022
112c3ed
modified set conditon and set action
Chibikuri Jan 29, 2022
e926a1f
add tests for actions and clauses
Chibikuri Jan 29, 2022
2bd933b
remove unused include
Chibikuri Feb 1, 2022
b0a4673
Merge pull request #368 from sfc-aqua/serialization
Chibikuri Feb 2, 2022
0dfe321
merge master into active_ruleset_dev
Chibikuri Feb 2, 2022
7be0185
add json function and prepare other serialization format
Chibikuri Feb 2, 2022
a465146
modified function name to _json
Chibikuri Feb 3, 2022
673782d
add protobuf for the next serialization format
Chibikuri Feb 3, 2022
be403f2
add draft protobuf
Chibikuri Feb 3, 2022
231a3be
fixed tests for conditions
Chibikuri Feb 3, 2022
4ac7b56
applied format
Chibikuri Feb 3, 2022
780608d
revert protobuf for now
Chibikuri Feb 4, 2022
ed8f19a
finish deserialize implementation
Chibikuri Feb 6, 2022
de87e6e
merge master into active_ruleset_dev
Chibikuri Feb 6, 2022
4355938
add constructor and used enum json converter
Chibikuri Feb 8, 2022
f19471e
applied enum json converter
Chibikuri Feb 9, 2022
8f92a5a
use get_to instead of inserting
Chibikuri Feb 10, 2022
5f97f00
modified deserialized function
Chibikuri Feb 10, 2022
f9792a0
fixed get to get_to for simplicity.
Chibikuri Feb 10, 2022
5f8e4a8
Merge pull request #370 from sfc-aqua/other_serialization_format
Chibikuri Feb 10, 2022
4462ded
Merge branch 'master' of github.com:sfc-aqua/quisp into active_rulese…
Chibikuri Feb 10, 2022
d34441b
add purifyRule in connection manager
Chibikuri Feb 11, 2022
74a1ca1
add swap rule generation
Chibikuri Feb 18, 2022
05c24f2
add wait rule
Chibikuri Feb 18, 2022
d31835a
add tomography rule
Chibikuri Feb 18, 2022
b376b63
rename functions
Chibikuri Feb 18, 2022
6db0e99
replace ruleset construction in connection manager
Chibikuri Feb 24, 2022
067465b
fixed next rule_id setting bug
Chibikuri Feb 24, 2022
f84ac79
applied format
Chibikuri Feb 24, 2022
fa9201a
add tests for ruleset generation
Chibikuri Feb 28, 2022
3845101
Merge branch 'master' of github.com:sfc-aqua/quisp into active_rulese…
Chibikuri Mar 7, 2022
1b815c4
add purification type parse function
Chibikuri Mar 8, 2022
3b0790e
fixed hard tabs
Chibikuri Mar 9, 2022
b720194
renamed finalized
Chibikuri Mar 9, 2022
fce3d6c
add rng seed
Chibikuri Mar 9, 2022
409d802
fix the test ruleset id
Chibikuri Mar 13, 2022
78738ab
removed unused seed
Chibikuri Mar 14, 2022
801aea6
Merge pull request #381 from sfc-aqua/ruleset_construction
Chibikuri Mar 14, 2022
ce3fd3f
Merge branch 'active_ruleset_dev' of github.com:sfc-aqua/quisp into a…
Chibikuri Mar 14, 2022
152d3cf
add ruleset creation part in RuleEngine
Chibikuri Mar 18, 2022
8fb1346
switch from deprecated function to new function and applied format
Chibikuri Mar 18, 2022
94dee6c
add qnic reservation test
Chibikuri Mar 21, 2022
2f4d37f
applied format
Chibikuri Mar 21, 2022
26fbe7e
removed old functions
Chibikuri Mar 21, 2022
75e05a1
add more tests for active ruleset generation
Chibikuri Mar 21, 2022
f55b445
modified json format
Chibikuri Mar 24, 2022
21f25d5
removed useless comment and cleaned up
Chibikuri Apr 10, 2022
0f0e6bd
Merge pull request #387 from sfc-aqua/active_ruleset_gen
Chibikuri Apr 11, 2022
50af6db
Merge branch 'master' of github.com:sfc-aqua/quisp into active_rulese…
Chibikuri Apr 11, 2022
0244fce
Merge branch 'master' of github.com:sfc-aqua/quisp into active_rulese…
Chibikuri May 6, 2022
f7fcf7f
fixed resource update for entanglement swapping
Chibikuri May 9, 2022
97ce421
updated resource update function
Chibikuri May 9, 2022
1744d57
update tests for resource update
Chibikuri May 9, 2022
fb73e2a
add shared tag system
Chibikuri May 10, 2022
349e55e
add shared tag to constructor
Chibikuri May 11, 2022
34c7b32
add exception tests for active ruleset constructions
Chibikuri May 30, 2022
cf6c37d
renamed rule array to rule map
Chibikuri Jun 5, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
[submodule "eigen"]
path = eigen
url = https://gitlab.com/libeigen/eigen.git
[submodule "json"]
path = json
url = https://github.com/nlohmann/json.git
[submodule "quispr"]
path = quispr
url = https://github.com/sfc-aqua/quispr
1 change: 1 addition & 0 deletions json
Submodule json added at 4f8fba
3 changes: 3 additions & 0 deletions quisp/makefrag
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ CXXFLAGS+=-ftest-coverage -fprofile-instr-generate -fcoverage-mapping
LDFLAGS+=-ftest-coverage -fprofile-instr-generate -fcoverage-mapping
endif

# include path for json
INCLUDE_PATH+=-I$(PROJ_ROOT)/json/include/

default: eigen all

format:
Expand Down
4 changes: 2 additions & 2 deletions quisp/messages/QNode_ipc_messages.msg
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ packet InternalRuleSetForwarding extends Header{
unsigned long RuleSet_id;
unsigned long Rule_id;

RuleSet* ruleSet;
json RuleSet;
}

packet InternalRuleSetForwarding_Application extends Header{
unsigned long RuleSet_id;
unsigned long Rule_id;
int application_type;

RuleSet* ruleSet;
json RuleSet;
}
13 changes: 10 additions & 3 deletions quisp/messages/base_messages.msg
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
cplusplus {{
#include "base_messages_m.h"
#include <modules/QNIC.h>
#include <rules/RuleSet.h>
using quisp::rules::RuleSet;
#include <rules/Active/ActiveRuleSet.h>
#include <nlohmann/json.hpp>
using quisp::rules::active::ActiveRuleSet;
using quisp::modules::QNIC_pair_info;
using nlohmann::json;
}}

class QNIC_type {
Expand All @@ -16,11 +18,16 @@ class QNIC_pair_info {
@opaque;
};

class RuleSet {
class ActiveRuleSet {
@existingClass;
@opaque;
};

class json {
@existingClass;
@opaque;
}

namespace quisp::messages;

packet Header
Expand Down
2 changes: 1 addition & 1 deletion quisp/messages/connection_setup_messages.msg
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ packet ConnectionSetupResponse extends Header
int actual_srcAddr;
int actual_destAddr;
unsigned long RuleSet_id;
RuleSet* ruleSet;
json ruleSet;
int application_type;
int stack_of_QNodeIndexes[];
}
8 changes: 7 additions & 1 deletion quisp/messages/entanglement_swapping_messages.msg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ namespace quisp::messages;

packet SwappingResult extends Header{
unsigned long RuleSet_id;
unsigned long Rule_id;
int Rule_id;
int shared_tag;
int action_index;

int left_Dest;
Expand Down Expand Up @@ -67,3 +68,8 @@ packet SimultaneousSwappingResult extends Header{
int index_in_path;
int path_length_exclude_IR;
}

packet WaitResult extends Header {
unsigned long RuleSet_id;
unsigned long Rule_id;
}
12 changes: 8 additions & 4 deletions quisp/messages/purification_messages.msg
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ packet PurificationResult extends Header
{
bool Output_is_plus;
unsigned long ruleset_id;
unsigned long rule_id;
int rule_id;
int shared_tag;
int action_index;
//For Debugging
omnetpp::cModule* entangled_with;
Expand All @@ -16,7 +17,8 @@ packet DoublePurificationResult extends Header
bool ZOutput_is_plus;
bool XOutput_is_plus;
unsigned long ruleset_id;
unsigned long rule_id;
int rule_id;
int shared_tag;
int action_index;
//For Debugging
omnetpp::cModule* entangled_with;
Expand All @@ -29,7 +31,8 @@ packet DS_DoublePurificationResult extends Header
bool DS_ZOutput_is_plus;
bool DS_XOutput_is_plus;
unsigned long ruleset_id;
unsigned long rule_id;
int rule_id;
int shared_tag;
int action_index;
//For Debugging
omnetpp::cModule* entangled_with;
Expand All @@ -41,7 +44,8 @@ packet DS_DoublePurificationSecondResult extends Header
bool XOutput_is_plus;
bool DS_Output_is_plus;
unsigned long ruleset_id;
unsigned long rule_id;
int rule_id;
int shared_tag;
int action_index;
//For Debugging
omnetpp::cModule* entangled_with;
Expand Down
2 changes: 1 addition & 1 deletion quisp/messages/tomography_messages.msg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ packet LinkTomographyRuleSet extends Header
{
int process_id;
int number_of_measuring_resources;
RuleSet* ruleSet;
ActiveRuleSet* activeRuleSet;
}

packet LinkTomographyRequest extends Header {}
Expand Down
8 changes: 8 additions & 0 deletions quisp/modules/QNIC.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,26 @@
#define QUISP_MODULES_QNIC_H_

#include <omnetpp.h>
#include <nlohmann/json.hpp>
using namespace omnetpp;

namespace quisp {
namespace modules {

using json = nlohmann::json;
typedef enum : int {
QNIC_E, /**< Emitter QNIC */
QNIC_R, /**< Receiver QNIC */
QNIC_RP, /**< Passive Receiver QNIC */
QNIC_N, /** Just to make the size of the array = the number of qnics*/
} QNIC_type;

NLOHMANN_JSON_SERIALIZE_ENUM(QNIC_type, {
{QNIC_E, "QNIC_E"},
{QNIC_R, "QNIC_R"},
{QNIC_RP, "QNIC_RP"},
})

static const char* QNIC_names[QNIC_N] = {
"qnic",
"qnic_r",
Expand Down
2 changes: 1 addition & 1 deletion quisp/modules/QNIC/StationaryQubit/IStationaryQubit.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class IStationaryQubit : public omnetpp::cSimpleModule {

virtual void setFree(bool consumed) = 0;
/*In use. E.g. waiting for purification result.*/
virtual void Lock(unsigned long rs_id, unsigned long rule_id, int action_id) = 0;
virtual void Lock(unsigned long rs_id, int rule_id, int action_id) = 0;
virtual void Unlock() = 0;
virtual bool isLocked() = 0;

Expand Down
2 changes: 1 addition & 1 deletion quisp/modules/QNIC/StationaryQubit/StationaryQubit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ void StationaryQubit::setFree(bool consumed) {
}

/*To avoid disturbing this qubit.*/
void StationaryQubit::Lock(unsigned long rs_id, unsigned long rule_id, int action_id) {
void StationaryQubit::Lock(unsigned long rs_id, int rule_id, int action_id) {
if (rs_id == -1 || rule_id == -1 || action_id == -1) {
error("ruleset_id || rule_id || action_id == -1");
}
Expand Down
2 changes: 1 addition & 1 deletion quisp/modules/QNIC/StationaryQubit/StationaryQubit.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class StationaryQubit : public IStationaryQubit {
StationaryQubit();
void setFree(bool consumed) override;
/*In use. E.g. waiting for purification result.*/
void Lock(unsigned long rs_id, unsigned long rule_id, int action_id) override;
void Lock(unsigned long rs_id, int rule_id, int action_id) override;
void Unlock() override;
bool isLocked() override;

Expand Down
Loading