package eVehicle_LogicalArchitecture { part eVehicle { part body; part battery; part engine; part frontAxis; part rearAxis; part frontWheel[2]; part rearWheel[2]; } } %show eVehicle_LogicalArchitecture %viz --view=tree eVehicle_LogicalArchitecture package SysMLv1ToSysMLv2MappingLibrary { part def SysMLModelElement; } package SysMLv1ToSysMLv2Mapping { import SysMLv1ToSysMLv2MappingLibrary::*; part SysMLv1 { part Block:SysMLModelElement; part Dependency:SysMLModelElement; part Package:SysMLModelElement; part PartProperty:SysMLModelElement; } part SysMLv2 { part Dependency:SysMLModelElement; part Package:SysMLModelElement; part Part:SysMLModelElement; part PartDefinition:SysMLModelElement; } // Mapping SysML v1 to SysML v2 dependency from SysMLv1::Block to SysMLv2::PartDefinition; dependency from SysMLv1::Dependency to SysMLv2::Dependency; dependency from SysMLv1::Package to SysMLv2::Package; dependency from SysMLv1::PartProperty to SysMLv2::Part; } %viz SysMLv1ToSysMLv2Mapping package eVehicle_LogicalArchitecture { import ScalarValues::Integer; part eVehicle { part body; part battery; part engine; part frontAxis; part rearAxis; part frontWheel[2] { value size : Integer; } part rearWheel[2] { value size : Integer; } } } %viz --view=tree eVehicle_LogicalArchitecture package eVehicleDefinitions { import ScalarValues::Integer; part def Wheel { value size : Integer; } } package eVehicle_LogicalArchitecture { import eVehicleDefinitions::*; part eVehicle { part body; part battery; part engine; part frontAxis; part rearAxis; part frontWheel : Wheel[2]; part rearWheel : Wheel[2]; } } %viz --view=tree eVehicle_Definitions %viz --view=tree eVehicle_LogicalArchitecture package eVehicle_Definitions { attribute def WheelSize { import ScalarValues::Integer; size : Integer; } part def Wheel { attribute sizeOfWheel : WheelSize; } } package eVehicle_LogicalArchitecture { import eVehicle_Definitions::*; part eVehicle { part body; part battery; part engine; part frontAxis; part rearAxis; part frontWheel : Wheel[2]; part rearWheel : Wheel[2]; } } %viz --view=tree eVehicle_Definitions %viz --view=tree eVehicle_LogicalArchitecture package eVehicle_LogicalArchitecture { import eVehicleDefinitions::*; part eVehicle { part body; part battery; part engine; part frontAxis; part rearAxis; part frontWheel : Wheel[2]; part rearWheel : Wheel[2]; connect battery to engine; connect engine to frontAxis; connect frontAxis to frontWheel; connect rearAxis to rearWheel; connect body to battery; connect body to engine; connect body to frontAxis; connect body to rearAxis; } } %viz --view=interconnection eVehicle_LogicalArchitecture::eVehicle package eVehicle_LogicalArchitecture { import eVehicleDefinitions::*; part eVehicle { part body; part battery { port powerOut; } part engine { port powerIn; } part frontAxis; part rearAxis; part frontWheel : Wheel[2]; part rearWheel : Wheel[2]; connect battery::powerOut to engine::powerIn; connect engine to frontAxis; connect frontAxis to frontWheel; connect rearAxis to rearWheel; connect body to battery; connect body to engine; connect body to frontAxis; connect body to rearAxis; } } %viz --view=interconnection eVehicle_LogicalArchitecture::eVehicle package eVehicleLibrary { import ScalarValues::Integer; attribute def ElectricEnergy; port def PowerOutPort { out energy : ElectricEnergy; } interface def PowerInterface { end supplierPort : PowerOutPort; end consumerPort : ~PowerOutPort; } } %viz --view=tree eVehicleLibrary package eVehicle_LogicalArchitecture { import eVehicleDefinitions::*; import eVehicleLibrary::*; part eVehicle { part body; part battery { attribute capacity : BatteryCapacity; port powerOut : PowerOutPort; } part engine { port powerIn : ~PowerOutPort; } part frontAxis; part rearAxis; part frontWheel : Wheel[2]; part rearWheel : Wheel[2]; interface : PowerInterface connect supplierPort => battery::powerOut to consumerPort => engine::powerIn; connect engine to frontAxis; connect frontAxis to frontWheel; connect rearAxis to rearWheel; connect body to battery; connect body to engine; connect body to frontAxis; connect body to rearAxis; } } %viz --view=interconnection eVehicle_LogicalArchitecture::eVehicle package eVehicleLibrary { import ScalarValues::Integer; attribute def ElectricEnergy; attribute def BatteryCapacity :> ScalarValues::Integer; port def PowerOutPort { out energy : ElectricEnergy; } interface def PowerInterface { end supplierPort : PowerOutPort; end consumerPort : ~PowerOutPort; } } package eVehicleDefinitions { import eVehicleLibrary::*; part def Wheel { value size : Integer; } part def Battery { value capacity : BatteryCapacity; } part def Engine; } package eVehicle_LogicalArchitecture { import eVehicleDefinitions::*; import eVehicleLibrary::*; part eVehicle { value maxSpeed :Speed = 142; part body; part battery : Battery { value redefines capacity = 42; port powerOut : PowerOutPort; } part engine : Engine { port powerIn : ~PowerOutPort; } part frontAxis; part rearAxis; part frontWheel : Wheel[2]; part rearWheel : Wheel[2]; interface : PowerInterface connect supplierPort => battery::powerOut to consumerPort => engine::powerIn; connect engine to frontAxis; connect frontAxis to frontWheel; connect rearAxis to rearWheel; connect body to battery; connect body to engine; connect body to frontAxis; connect body to rearAxis; } } %viz eVehicle_LogicalArchitecture package eVehicle_VariantModel { import eVehicle_LogicalArchitecture::*; package eVehicle_Configurations { import eVehicle_Variations::*; part eVehicleStandard :> eVehicleVariations { part redefines engine :> standardEngine; part redefines battery :> batteryLow; } part eVehiclePremium :> eVehicleVariations { part redefines engine :> powerEngine; part redefines battery :> batteryHigh; } part INVALIDeVehicle :> eVehicleVariations { part redefines engine :> powerEngine; part redefines battery :> batteryLow; } } package eVehicle_Variations { import eVehicle_Variants::*; abstract part eVehicleVariations :> eVehicle { variation part redefines battery : Battery { variant part batterLow; variant part batteryHigh; } variation part redefines engine : Engine { variant part standardEngine; variant part powerEngine; } abstract constraint { (battery == batteryLow & engine == standardEngine) ^ (battery == batteryHigh) } } } package eVehicle_Variants { part batteryLow : Battery { value redefines capacity = 40; } part batteryHigh : Battery { value redefines capacity = 40; } part powerEngine : Engine; part standardEngine : Engine; } } %viz --view=tree eVehicle_VariantModel::eVehicle_Variations::eVehicleVariations %viz --view=tree eVehicle_VariantModel::eVehicle_Configurations package eVehicle_LogicalArchitecture_ExplosionExample { import eVehicleDefinitions::*; import eVehicleLibrary::*; part eVehicle { part engine : Engine; part frontAxis { part frontWheel[2] { part lugBolt[6]; part boltCircle; connect boltCircle to lugBolt; } part housing; connect housing to frontWheel; } part rearAxis { part rearWheel[2] { part lugBolt[6]; part boltCircle; connect boltCircle to lugBolt; } part housing; connect housing to rearWheel; } connect engine to frontAxis; } } %viz --view=interconnection eVehicle_LogicalArchitecture package eVehicleVariants_ExplosionExample { part lugBolt42; part lugBolt23; } package eVehicle_LogicalArchitecture_ExplosionExample { import eVehicleDefinitions::*; import eVehicleLibrary::*; import eVehicleVariants_ExplosionExample::*; part eVehicle { part engine : Engine; part frontAxis { part frontWheel[2] { /*----------------------------- * Definition of the variation * ----------------------------*/ variation part lugBolt[6] { variant part lugBolt23; variant part lugBolt42; } part boltCircle; connect boltCircle to lugBolt; } part housing; connect housing to frontWheel; } part rearAxis { part rearWheel[2] { part lugBolt[6]; part boltCircle; connect boltCircle to lugBolt; } part housing; connect housing to rearWheel; } connect engine to frontAxis; } } %viz --view=tree eVehicle_LogicalArchitecture package eVehicle_Edition42 { import eVehicle_LogicalArchitecture_ExplosionExample::*; part eVehicle42 :> eVehicle { part redefines lugBolt42 :> frontAxis::frontWheel::lugBolt; } } package eVehicleRequirementDefinitions { import eVehicleDefinitions::*; requirement def BatteryCapacityReqDef { doc /* The actual battery capacity shall be greater than or equal * to the required capacity. */ attribute capacityActual : BatteryCapacity; attribute capacityRequired : BatteryCapacity; require constraint{ capacityActual <= capacityRequired } } requirement def MaxSpeedReqDef { doc /* The maximum speed of the vehicle shall be * not greater than the required maximum speed. */ attribute maxSpeedVehicle : Speed; attribute maxSpeedRequired : Speed; require constraint{ maxSpeedVehicle <= maxSpeedRequired } } } %viz eVehicleRequirementDefinitions %viz eVehicle_LogicalArchitecture::eVehicle package eVehicleRequirements { import eVehicleRequirementDefinitions::*; import eVehicle_LogicalArchitecture::*; requirement eVehicleSpecification { doc /* Requirement Specification of the eVehicle */ subject eVehicle :>> eVehicle; require eVehicleBatteryCapacity; require eVehicleMaxSpeed; } requirement id 'REQ.B.1' eVehicleBatteryCapacity : BatteryCapacityReqDef { subject eVehicle :>> eVehicle; attribute :>> capacityRequired = 50; attribute :>> capacityActual = eVehicle::battery::capacity; } requirement id 'REQ.V.1' eVehicleMaxSpeed : MaxSpeedReqDef { subject eVehicle :>> eVehicle; attribute :>> maxSpeedRequired = 140; attribute :>> maxSpeedVehicle = eVehicle::maxSpeed; } } %viz eVehicleRequirements package eVehicle_LogicalArchitecture { import eVehicleDefinitions::*; import eVehicleLibrary::*; import eVehicleRequirements::*; part eVehicleContext { part eVehicle { value maxSpeed :Speed = 142; part body; part battery : Battery { value redefines capacity = 42; port powerOut : PowerOutPort; } part engine : Engine { port powerIn : ~PowerOutPort; } part frontAxis; part rearAxis; part frontWheel : Wheel[2]; part rearWheel : Wheel[2]; interface : PowerInterface connect supplierPort => battery::powerOut to consumerPort => engine::powerIn; connect engine to frontAxis; connect frontAxis to frontWheel; connect rearAxis to rearWheel; connect body to battery; connect body to engine; connect body to frontAxis; connect body to rearAxis; } satisfy eVehicleSpecification by eVehicle; } } package SysMLv1ToSysMLv2MappingLibrary { part def SysMLModelElement; } package SysMLv1ToSysMLv2Mapping { doc /* Mapping of SysML v1 model elements to SysML v2 */ import SysMLv1ToSysMLv2MappingLibrary::*; part SysMLv1 { part AssociationBlock:SysMLModelElement; part Block:SysMLModelElement; part Connector:SysMLModelElement; part Dependency:SysMLModelElement; part 'Import':SysMLModelElement; part Package:SysMLModelElement; part PartProperty:SysMLModelElement; part Port:SysMLModelElement; part Requirement:SysMLModelElement; part ValueProperty:SysMLModelElement; } part SysMLv2 { part Attribute:SysMLModelElement; part Connection:SysMLModelElement; part Dependency:SysMLModelElement; part 'Import':SysMLModelElement; part InterfaceDefinition:SysMLModelElement; part Package:SysMLModelElement; part Part:SysMLModelElement; part PartDefinition:SysMLModelElement; part Port:SysMLModelElement; part RequirementDefinition:SysMLModelElement; part 'Variant':SysMLModelElement; part 'Variation':SysMLModelElement; } // Mapping SysML v1 to SysML v2 dependency from SysMLv1::AssociationBlock to SysMLv2::InterfaceDefinition; dependency from SysMLv1::Block to SysMLv2::PartDefinition; dependency from SysMLv1::Connector to SysMLv2::Connection; dependency from SysMLv1::Dependency to SysMLv2::Dependency; dependency from SysMLv1::'Import' to SysMLv2::'Import'; dependency from SysMLv1::Package to SysMLv2::Package; dependency from SysMLv1::PartProperty to SysMLv2::Part; dependency from SysMLv1::Port to SysMLv2::Port; dependency from SysMLv1::Requirement to SysMLv2::RequirementDefinition; dependency from SysMLv1::ValueProperty to SysMLv2::Attribute; } %viz --view=interconnection SysMLv1ToSysMLv2Mapping package eVehicleLibrary { attribute def ElectricEnergy; attribute def BatteryCapacity :> ScalarValues::Integer; attribute def Speed :> ScalarValues::Integer; port def PowerOutPort { out energy : ElectricEnergy; } interface def PowerInterface { end supplierPort : PowerOutPort; end consumerPort : ~PowerOutPort; } } package eVehicleDefinitions { import eVehicleLibrary::*; part def Wheel { value size : ScalarValues::Integer; } part def Battery { value capacity : BatteryCapacity; } part def Engine; } %viz eVehicleLibrary %viz eVehicleDefinitions package SYSMOD { doc /* SYSMOD - The Systems Modeling Toolbox, Version 5.0beta */ requirement def Objective { doc /* A objective is an objective of the system. It is a special kind of a requirement that is typically not satisfied but amplified by the system. */ } part def System { doc /* Marks the system under development. Typically there is only one block in the model with that stereotype. However in a System of Systems (SoS) model there could be more. */ import ScalarValues::String; value problemStatement : String; value systemIdea : String; } } %viz SYSMOD package ForestFireDetectionSystemModel { import SYSMOD::*; package FFDS_Core { part FFDS : System { value redefines problemStatement = "How can we provide a forest fire detection system for forest authorities that can be scaled to any forest size, is affordable, highly reliable and accurate in detecting forest fires."; value redefines systemIdea = "The FFDS is a satellite-based system to detect forest fires in very large areas. The system is also equipped with stationary sensors and animal sensors. Using different sources for the fire detection increases the reliability of the system and enables different system configurations for different environmental contexts and price segments. Main features of the FFDS are Detecting and reporting forest fires on time Monitoring forest and fires Uses the behavior of forest animals to detect fires"; } package FFDS_Requirements { package FFDS_Objectives { requirement id 'OBJ-B1' 'Market Leader' : Objective { doc /* The system will make the vendor the market leader for forest fire detection systems. */ } requirement id 'OBJ-S1' 'Reliable Detection' : Objective { doc /* Any forest fire is detected by the system on time to start effective counteractions. */ } requirement id 'OBJ-S2' 'Affordability' : Objective { doc /* The system is affordable for any forest authority. */ } } } } } %viz ForestFireDetectionSystemModel package ForestFireDetectionSystemModel { import SYSMOD::*; package FFDS_Core { part 'FFDS System Context' : SystemContext { part FFDS : System :> systemOfInterest { value redefines problemStatement = "How can we provide a forest fire detection system for forest authorities that can be scaled to any forest size, is affordable, highly reliable and accurate in detecting forest fires."; value redefines systemIdea = "The FFDS is a satellite-based system to detect forest fires in very large areas. The system is also equipped with stationary sensors and animal sensors. Using different sources for the fire detection increases the reliability of the system and enables different system configurations for different environmental contexts and price segments. Main features of the FFDS are Detecting and reporting forest fires on time Monitoring forest and fires Uses the behavior of forest animals to detect fires"; } part Operator : User subsets actors; part Administrator : User subsets actors; part 'Forest Ranger' : User subsets actors; part Maintenance : User subsets actors; part 'Fire Department' : ExternalSystem subsets actors; part 'Meteorology data system' : ExternalSystem subsets actors; part 'Research analysis system' : ExternalSystem subsets actors; part 'Weather' : EnvironmentalEffect subsets actors; part 'Fire' : EnvironmentalEffect subsets actors; part 'Planet Environment' : EnvironmentalImpact subsets actors; } package FFDS_Requirements { package FFDS_Objectives { requirement id 'OBJ-B1' 'Market Leader' : Objective { doc /* The system will make the vendor the market leader for forest fire detection systems. */ } requirement id 'OBJ-S1' 'Reliable Detection' : Objective { doc /* Any forest fire is detected by the system on time to start effective counteractions. */ } requirement id 'OBJ-S2' 'Affordability' : Objective { doc /* The system is affordable for any forest authority. */ } } } } } %viz ForestFireDetectionSystemModel package SYSMOD { doc /* SYSMOD - The Systems Modeling Toolbox, Version 5.0beta */ requirement def Objective { doc /* A objective is an objective of the system. It is a special kind of a requirement that is typically not satisfied but amplified by the system. */ } part def System { doc /* Marks the system under development. Typically there is only one block in the model with that stereotype. However in a System of Systems (SoS) model there could be more. */ import ScalarValues::String; value problemStatement : String; value systemIdea : String; } part def SystemContext { doc /* A system context is a wrapper around the system and it's actors to allow a detailed system context modeling. The system context references the appropriate system. This is important in a SoS model. */ part systemOfInterest : System; part actors[0..*]; } part def User; part def ExternalSystem; part def EnvironmentalEffect; part def EnvironmentalImpact; } %viz SYSMOD package TheFASJukeBox { package FASLanguage { part def FunctionalBlock; } package UseCases { activity '(Un)install and Move Jukebox'; activity 'Ask for Track to Play'; activity 'Assemble Music Collection'; activity 'Connect Jukebox with Electrical Supply'; activity 'Disconnect from Electrical Supply'; activity 'Distribute Energy'; activity 'Get Energy'; activity 'Get Mechanical Energy'; activity 'Get Money'; activity 'Insert Cash'; activity 'Install Jukebox'; activity 'Listen to Music'; activity 'Make Music Available'; activity 'Monitor Payment'; activity 'Play Music Track'; activity 'Produce Sound'; activity 'Provide Music Track'; activity 'Retrieve Identification of Music Track'; activity 'Retrieve Money'; activity 'Supply Jukebox with Energy'; activity 'Transform Mechanical Engery into Something Harmless'; activity 'Uninstall Jukebox'; activity 'Use Means of Music Transfer to Retrieve Music'; } package DomainKnowledge { item def AudioSignal; item def ClearanceToPlayMusic; item def ElectricalEnergy; item def IdentificationOfMusicTrack; item def MechanicalEnergy; item def Money; item def MusicTrack; } package FunctionalArchitecture { import UseCases::*; import DomainKnowledge::*; import FASLanguage::*; import SYSMOD::*; package FunctionalInterfaces { port def AudioSignalPort { out item a : AudioSignal; } port def ClearanceToPlayMusicPort { out item m : ClearanceToPlayMusic; } port def ElectricalEnergyPort { out item e : ElectricalEnergy; } port def IdentificationOfMusicTrackPort { out item m : IdentificationOfMusicTrack; } port def MechanicalEnergyPort { out item m : MechanicalEnergy; } port def MoneyPort { out item m : Money; } port def MusicTrackPort { out item m : MusicTrack; } } part TheFASJukeBoxFunctionalContext { import FunctionalInterfaces::*; part TheFASJukeBoxFunctionalArchitecture { dependency from TheFASJukeBoxFunctionalArchitecture to '(Un)install and Move Jukebox'; dependency from TheFASJukeBoxFunctionalArchitecture to 'Assemble Music Collection'; dependency from TheFASJukeBoxFunctionalArchitecture to 'Listen to Music'; dependency from TheFASJukeBoxFunctionalArchitecture to 'Supply Jukebox with Energy'; part 'I/O Customer' : FunctionalBlock { dependency from 'I/O Customer' to 'Ask for Track to Play'; dependency from 'I/O Customer' to 'Get Money'; dependency from 'I/O Customer' to 'Produce Sound'; port p1 : MoneyPort; port p2 : ~AudioSignalPort; port p3 : IdentificationOfMusicTrackPort; } part 'I/O Electrical Supply' : FunctionalBlock { dependency from 'I/O Electrical Supply' to 'Get Energy'; port p1 : ElectricalEnergyPort; } part 'I/O Music Supplier' : FunctionalBlock { dependency from 'I/O Music Supplier' to 'Use Means of Music Transfer to Retrieve Music'; port p1 : MusicTrackPort; } part 'I/O Pub Interior' : FunctionalBlock { dependency from 'I/O Pub Interior' to 'Get Mechanical Energy'; port p1 : MechanicalEnergyPort; } part 'I/O Pub Manager' : FunctionalBlock { dependency from 'I/O Pub Manager' to 'Connect Jukebox with Electrical Supply'; dependency from 'I/O Pub Manager' to 'Disconnect from Electrical Supply'; dependency from 'I/O Pub Manager' to 'Insert Cash'; dependency from 'I/O Pub Manager' to 'Retrieve Identification of Music Track'; port p1 : IdentificationOfMusicTrackPort; } part Accounting : FunctionalBlock { dependency from Accounting to 'Monitor Payment'; port p1 : ClearanceToPlayMusicPort; port p2 : ~MoneyPort; } part 'Energy Distribution' : FunctionalBlock { dependency from 'Energy Distribution' to 'Distribute Energy'; port p1 : ~ElectricalEnergyPort; } part 'Music Player' : FunctionalBlock { dependency from 'Music Player' to 'Play Music Track'; port p1 : AudioSignalPort; } part 'Music Storage' : FunctionalBlock { dependency from 'Music Storage' to 'Make Music Available'; dependency from 'Music Storage' to 'Provide Music Track'; port p1 : ~IdentificationOfMusicTrackPort; port p2 : ~MusicTrackPort; port p3 : ClearanceToPlayMusicPort; } part Suspension : FunctionalBlock { dependency from Suspension to 'Uninstall Jukebox'; port p1 : ~MechanicalEnergyPort; } connect 'I/O Pub Manager'::p1 to 'Music Storage'::p1; connect 'I/O Pub Manager' to 'Accounting'; connect 'I/O Music Supplier'::p1 to 'Music Storage'::p2; connect 'Accounting'::p1 to 'Music Storage'::p3; connect 'I/O Customer'::p1 to Accounting::p2; connect 'Music Player'::p1 to 'I/O Customer'::p2; connect 'I/O Customer'::p3 to 'Music Storage'::p1; connect 'I/O Electrical Supply'::p1 to 'Energy Distribution'::p1; connect 'I/O Pub Interior'::p1 to Suspension::p1; } part Customer : User; part 'Pub Manager' : User; part 'Music Supplier' : ExternalSystem; part 'Electrical Supply' : ExternalSystem; part 'Pub Interior' : ExternalSystem; connect 'Pub Manager' to TheFASJukeBoxFunctionalArchitecture::'I/O Pub Manager'; connect 'Music Supplier' to TheFASJukeBoxFunctionalArchitecture::'I/O Music Supplier'; connect Customer to TheFASJukeBoxFunctionalArchitecture::'I/O Customer'; connect 'Electrical Supply' to TheFASJukeBoxFunctionalArchitecture::'I/O Electrical Supply'; connect 'Pub Interior' to TheFASJukeBoxFunctionalArchitecture::'I/O Pub Interior'; } } } %viz --view=tree TheFASJukeBox %viz --view=interconnection TheFASJukeBox::FunctionalArchitecture::TheFASJukeBoxFunctionalContext