RAMification adds 'name' attribute, giving control over the names of created objects

This commit is contained in:
Joeri Exelmans 2024-12-03 20:28:16 +01:00
parent 7c01b126c2
commit da4f1718ce
8 changed files with 64 additions and 32 deletions

View file

@ -1,6 +1,9 @@
# Auto-generated by /home/maestro/repos/MV2/examples/semantics/translational/regenerate_mm.py
# Auto-generated by /home/maestro/repos/MV2/examples/semantics/translational/regenerate_mm.py.
# PlantUML visualization: https://deemz.org/plantuml/pdf/hPT1Zzem48Nl-HKMnqeWqcG1HLKFkuUg5nO9f1wHSSPiHB2HOofLxVxtsYOWTXKfByWSkCtdcNdFuqaYQjuqRFJ2JrnKzi-BLeqrl5AMZHXlsBJzRJl-_2-ZajZVXB7chJfT8QnWFvMbFPdaFMaFM2rNDHUqjjmIYgQdW5RduqOVI3LTt5_Q7CYi2SwNn1Lw2Usa3afJPexudl2Txvomx9uXppMCuTqOVJO2pKMcym2vgbfhSM3fP9A2uLaUccEh8tMrvPcCVHlI6pcRNzpXOiw-qsjhAhNlA7EZJoXpaT_N66o5XlBqFlJcdK4bySKz8xG43fNteJz8aU5M6pHyD_jG-79Zk6egMsa54yfEZwsMxjuh4fRlQhWF8k_sQwKEA88-oD7cuCePf8Uy3A2Z_asbSzYprZLnzSaW0uZvT7gREsitrJe7H3lEOA88XIQzrVWfyEtVUDpF_4fvFyxV5GZdvtXCd9CMmBdh2EAuZDWx_mW0sRbPYcO75EkV2KnPvx-eoieighBfF2ekYsjZoMCQ1L9sGB42A1OsYd-AWEm8lsJznORX2E9cCOsIPpcWh7-KmEnsPLGfPDJnwLRVg0DgDujxAu1f34lXNqVePSpOA6MJ2NFBx7ZytJsz8sohBfW6y_N8W9xwSxu0V1zLC6w0zyH_UTmEIE43tCvOCC7LwyalYuZBd2qUACID2NVERGL3wdaQBaXOXGfsKbj8ayL3cYoy9dk_NLTYMxjz55b55e-S5CIfceis_iEclsibFUI2e4xxVVqg_mC=
# Merged run-time meta-models of 'Petri Net' and 'Port' formalisms.
# An abstract 'Top'-class (superclass of everything else), and a 'generic_link'-association (which can connect everything with everything) have also been added.
# PlantUML visualization: https://deemz.org/plantuml/pdf/hPTDZzem48Rl-HKMnqgWa0sKeAg7tKFL2ui4KezeuXWs8jYHOofLxVxtZiE7s5KatY3dm8bvF3Flp7WSoOgQHWnUg2PPkZylHZVEKgcT60XgH7p-DXq__alZMIh-Ha8qRsLzWOYv-AcTsYaRlKVd0vQBPKLIhHmv1QFp5gsFXxNPAzrqSNyPkrTsfM1_i-G2FPbsKdkvcMLCV8yezvcJJjmojiSAnL3SZJ57As5VygA5N5IjZDoByMWq1iqBQfFZoeFgIikpikwjJsx6SN6g3hOv-aold2trhYFCjQbHPaAtCRPbXPgcNszDhxNJAwHKtJBQbA2caycjwG-bbILdB6mkFmI-M5lIJUbAer72zAcpnfOBxdkjfAEyWlCmfUvwBVKUHSm-o77sWSFffGUT1j31_5O5LzYpCPKY_Qb0-X6lSsV5KwrpG9p76KhCapRGwEu__HJuzcyulCzCPtGVvti5m_4S3ubZQKFYqcqCuBYxGUycav1Iy9q2u7WqWzwbGExyhGFYA0zQA5aM59SNGN55sAuWeExmGe6KxT5aKo3O7eMIAi2x6TnaKB0yQq5SZ1JA5C_TKzWc2pe-UVKDEb4cCcWP8-EpXnHvWjoChCLWB4OZmSliSFYThzu1jbNFXTbY_dfaYuxzELy0lhUQ2x98VldbSJrW31_0E-DSIDAljLyMWGxrPV508DpNVCvr1GFEuUTPVq7yAZGNjTv0cYGFQP9uJNP-koxbfk9z5DaTr2CdjUAKpKaR_x01ifO-KWLfgyxvVVsw_Gy=
CapacityConstraint:Class
@ -74,16 +77,17 @@ operatingCapacities:GlobalConstraint {
```;
}
WorkerSet_numWorkers:AttributeLink (WorkerSet -> Integer) {
constraint = `get_value(get_target(this)) >= 0`;
optional = False;
name = "numWorkers";
constraint = `get_value(get_target(this)) >= 0`;
}
PlaceState_numShips:AttributeLink (PlaceState -> Integer) {
optional = False;
name = "numShips";
constraint = `get_value(get_target(this)) >= 0`;
optional = False;
}
ConnectionState_moved:AttributeLink (ConnectionState -> Boolean) {
name = "moved";
constraint = ```
result = True
all_successors_moved = True
@ -101,26 +105,25 @@ ConnectionState_moved:AttributeLink (ConnectionState -> Boolean) {
result
```;
optional = False;
name = "moved";
}
BerthState_status:AttributeLink (BerthState -> String) {
name = "status";
constraint = ```
(
get_value(get_target(this)) in { "empty", "unserved", "served" }
)
```;
optional = False;
name = "status";
}
PNPlaceState_numTokens:AttributeLink (PNPlaceState -> Integer) {
constraint = `"numTokens cannot be negative" if get_value(get_target(this)) < 0 else None`;
optional = False;
name = "numTokens";
constraint = `"numTokens cannot be negative" if get_value(get_target(this)) < 0 else None`;
}
Clock_time:AttributeLink (Clock -> Integer) {
name = "time";
constraint = `get_value(get_target(this)) >= 0`;
optional = False;
name = "time";
}
CapacityConstraint_shipCapacity:AttributeLink (CapacityConstraint -> Integer) {
constraint = `get_value(get_target(this)) >= 0`;
@ -128,10 +131,10 @@ CapacityConstraint_shipCapacity:AttributeLink (CapacityConstraint -> Integer) {
name = "shipCapacity";
}
of:Association (State -> Stateful) {
target_lower_cardinality = 1;
source_upper_cardinality = 1;
source_lower_cardinality = 1;
target_upper_cardinality = 1;
target_lower_cardinality = 1;
}
arc:Association (PNConnectable -> PNConnectable)
canOperate:Association (WorkerSet -> Berth) {
@ -139,10 +142,10 @@ canOperate:Association (WorkerSet -> Berth) {
}
connection:Association (Source -> Sink)
pn_of:Association (PNPlaceState -> PNPlace) {
source_lower_cardinality = 1;
target_upper_cardinality = 1;
target_lower_cardinality = 1;
source_upper_cardinality = 1;
source_lower_cardinality = 1;
}
generic_link:Association (Top -> Top)
isOperating:Association (WorkerSetState -> Berth) {
@ -171,6 +174,7 @@ capacityOf:Association (CapacityConstraint -> Place) {
:Inheritance (connection -> Stateful)
:Inheritance (CapacityConstraint -> Top)
:Inheritance (Sink -> Top)
:Inheritance (generic_link -> Top)
:Inheritance (Berth -> Place)
:Inheritance (WorkerSet -> Stateful)
:Inheritance (Place -> Source)
@ -184,7 +188,6 @@ capacityOf:Association (CapacityConstraint -> Place) {
:Inheritance (WorkerSetState -> State)
:Inheritance (Place -> Sink)
:Inheritance (BerthState -> PlaceState)
:Inheritance (generic_link -> Top)
:Inheritance (PNTransition -> PNConnectable)
:Inheritance (ConnectionState -> State)
:Inheritance (PNPlaceState -> Top)

View file

@ -56,7 +56,9 @@ if __name__ == "__main__":
filename = THIS_DIR+"/merged_mm.od"
with open(filename, "w") as file:
file.write(f"# Auto-generated by {__file__}\n\n")
file.write(f"# Auto-generated by {__file__}.\n\n")
file.write(f"# Merged run-time meta-models of 'Petri Net' and 'Port' formalisms.\n")
file.write(f"# An abstract 'Top'-class (superclass of everything else), and a 'generic_link'-association (which can connect everything with everything) have also been added.\n\n")
file.write(f"# PlantUML visualization: {plantuml_url}\n\n")
file.write(txt)