Skip to content

Commit 2705944

Browse files
committed
Updated SysML training examples.
1 parent 098f6ec commit 2705944

File tree

8 files changed

+96
-17
lines changed

8 files changed

+96
-17
lines changed

kerml/src/examples/Simple Tests/Classes.kerml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ package Classes {
99
}
1010

1111
abstract class B {
12-
public abstract a: A;
13-
packaged abstract x: C;
12+
public abstract feature a: A;
13+
packaged abstract feature x: C;
1414
package P { }
1515
}
1616

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package 'Comment Example' {
2+
/* This is documentary comment, part of the model,
3+
* annotating (by default) its owning package. */
4+
5+
comment Comment1 /* This is a named documentary comment. */
6+
7+
comment on Automobile
8+
/* This is an unnamed documentary comment,
9+
* annotating an explicitly specified element.
10+
*/
11+
12+
block Automobile;
13+
14+
/**
15+
* This is a documentary comment, annotating the
16+
* following element.
17+
*/
18+
block Car is Automobile;
19+
20+
// This is a lexical comment ("note").
21+
// It is in the text, but not part of the model.
22+
private value type Torque is ISQ::TorqueValue;
23+
}
Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
1-
/**
2-
* This is a documentary comment.
3-
* It is part of the model.
4-
*/
51
package 'Package Example' {
62
private import ScalarValues::*;
7-
8-
/*
9-
* This is a lexical comment ("note").
10-
* It is in the text, but not part of the model.
11-
*/
3+
124
block Automobile;
135

14-
block Car is Automobile; // This is also a lexical comment.
6+
block Car is Automobile;
157

16-
private value type Torque is ISQ::TorqueValue;
8+
private value type Torque is ISQ::TorqueValue;
179
}

sysml/src/training/08. Ports/Port Conjugation Example.sysml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ package 'Port Conjugation Example' {
1111
}
1212

1313
block FuelTank {
14-
port fuelTankPort : ~FuelPort;
14+
port fuelTankPort : FuelPort;
1515
}
1616

1717
block Engine {
18-
port engineFuelPort : FuelPort;
18+
port engineFuelPort : ~FuelPort;
1919
}
2020
}

sysml/src/training/16. Control/Camera.sysml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package 'Allocation Example' {
1+
package Camera {
22
import 'Action Decomposition'::*;
33

44
block Camera;
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package 'Decision Example' {
2+
import ScalarValues::*;
3+
4+
value type BatteryCharged;
5+
6+
part battery;
7+
part powerSystem;
8+
9+
activity AddCharge (in charge : Real);
10+
11+
activity ChargeBattery {
12+
first start;
13+
14+
then merge continueCharging;
15+
16+
then accept monitor (batteryCharge : Real);
17+
18+
then decide;
19+
if monitor::batteryCharge < 100 then addCharge;
20+
if monitor::batteryCharge >= 100 then signalCharged;
21+
22+
action addCharge : AddCharge (batteryCharge);
23+
then continueCharging;
24+
25+
send signalCharged of BatteryCharged() to powerSystem;
26+
then done;
27+
}
28+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package 'Fork Join Example' {
2+
import ScalarValues::*;
3+
4+
value type TurnKeyToOn;
5+
value type BrakePressure;
6+
7+
activity MonitorBrakePedal(out brakePressure : BrakePressure);
8+
activity MonitorTraction(out modulationFrequency : Real);
9+
activity Braking(in brakePressure : BrakePressure, in modulationFrequency : Real);
10+
11+
activity Brake {
12+
accept (TurnKeyToOn);
13+
14+
then fork;
15+
then monitorBrakePedal;
16+
then monitorTraction;
17+
then braking;
18+
19+
action monitorBrakePedal : MonitorBrakePedal (
20+
out brakePressure
21+
);
22+
then joinNode;
23+
24+
action monitorTraction : MonitorTraction (
25+
out modulationFrequency);
26+
then joinNode;
27+
28+
action braking : Braking(
29+
in stream from monitorBrakePedal::brakePressure,
30+
in stream from monitorTraction::modulationFrequency);
31+
then joinNode;
32+
33+
join joinNode;
34+
then done;
35+
}
36+
}

sysml/src/training/16. Control/Control Example.sysml renamed to sysml/src/training/16. Control/Merge Example.sysml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package 'Control Example' {
1+
package 'Merge Example' {
22
block Scene;
33
block Image;
44
block Picture;

0 commit comments

Comments
 (0)