From 681c5de6cf5bc6e860551dc189dedba8f2c8c84f Mon Sep 17 00:00:00 2001 From: Yadunand Prem Date: Thu, 8 Sep 2022 02:00:01 +0800 Subject: [PATCH] feat: add L3 inputs --- inputs/Lab3.1.in | 4 +++ inputs/Lab3.10.in | 6 +++++ inputs/Lab3.11.in | 6 +++++ inputs/Lab3.12.in | 12 +++++++++ inputs/Lab3.13.in | 12 +++++++++ inputs/Lab3.14.in | 13 ++++++++++ inputs/Lab3.15.in | 13 ++++++++++ inputs/Lab3.2.in | 4 +++ inputs/Lab3.3.in | 7 +++++ inputs/Lab3.4.in | 7 +++++ inputs/Lab3.5.in | 5 ++++ inputs/Lab3.6.in | 5 ++++ inputs/Lab3.7.in | 4 +++ inputs/Lab3.8.in | 6 +++++ inputs/Lab3.9.in | 6 +++++ outputs/ArrayTest.out | 55 +++++++++++++++++++++++++++++++++++++++ outputs/Lab3.1.out | 12 +++++++++ outputs/Lab3.10.out | 20 +++++++++++++++ outputs/Lab3.11.out | 18 +++++++++++++ outputs/Lab3.12.out | 52 +++++++++++++++++++++++++++++++++++++ outputs/Lab3.13.out | 52 +++++++++++++++++++++++++++++++++++++ outputs/Lab3.14.out | 56 ++++++++++++++++++++++++++++++++++++++++ outputs/Lab3.15.out | 60 +++++++++++++++++++++++++++++++++++++++++++ outputs/Lab3.2.out | 14 ++++++++++ outputs/Lab3.3.out | 23 +++++++++++++++++ outputs/Lab3.4.out | 26 +++++++++++++++++++ outputs/Lab3.5.out | 16 ++++++++++++ outputs/Lab3.6.out | 16 ++++++++++++ outputs/Lab3.7.out | 12 +++++++++ outputs/Lab3.8.out | 20 +++++++++++++++ outputs/Lab3.9.out | 23 +++++++++++++++++ outputs/QueueTest.out | 34 ++++++++++++++++++++++++ 32 files changed, 619 insertions(+) create mode 100755 inputs/Lab3.1.in create mode 100755 inputs/Lab3.10.in create mode 100755 inputs/Lab3.11.in create mode 100755 inputs/Lab3.12.in create mode 100755 inputs/Lab3.13.in create mode 100755 inputs/Lab3.14.in create mode 100755 inputs/Lab3.15.in create mode 100755 inputs/Lab3.2.in create mode 100755 inputs/Lab3.3.in create mode 100755 inputs/Lab3.4.in create mode 100755 inputs/Lab3.5.in create mode 100755 inputs/Lab3.6.in create mode 100755 inputs/Lab3.7.in create mode 100755 inputs/Lab3.8.in create mode 100755 inputs/Lab3.9.in create mode 100755 outputs/ArrayTest.out create mode 100755 outputs/Lab3.1.out create mode 100755 outputs/Lab3.10.out create mode 100755 outputs/Lab3.11.out create mode 100755 outputs/Lab3.12.out create mode 100755 outputs/Lab3.13.out create mode 100755 outputs/Lab3.14.out create mode 100755 outputs/Lab3.15.out create mode 100755 outputs/Lab3.2.out create mode 100755 outputs/Lab3.3.out create mode 100755 outputs/Lab3.4.out create mode 100755 outputs/Lab3.5.out create mode 100755 outputs/Lab3.6.out create mode 100755 outputs/Lab3.7.out create mode 100755 outputs/Lab3.8.out create mode 100755 outputs/Lab3.9.out create mode 100755 outputs/QueueTest.out diff --git a/inputs/Lab3.1.in b/inputs/Lab3.1.in new file mode 100755 index 0000000..f49afb1 --- /dev/null +++ b/inputs/Lab3.1.in @@ -0,0 +1,4 @@ +3 1 0 2 +1.0 1.0 +3.0 1.0 +5.0 1.0 diff --git a/inputs/Lab3.10.in b/inputs/Lab3.10.in new file mode 100755 index 0000000..fa73cc4 --- /dev/null +++ b/inputs/Lab3.10.in @@ -0,0 +1,6 @@ +5 2 0 2 +1.0 1.5 +1.2 1.0 +1.4 1.0 +1.6 1.0 +2.1 1.0 diff --git a/inputs/Lab3.11.in b/inputs/Lab3.11.in new file mode 100755 index 0000000..ad04e60 --- /dev/null +++ b/inputs/Lab3.11.in @@ -0,0 +1,6 @@ +5 1 2 0 +1.0 1.0 +1.1 1.0 +1.2 1.0 +1.3 1.0 +1.4 1.0 diff --git a/inputs/Lab3.12.in b/inputs/Lab3.12.in new file mode 100755 index 0000000..969ed14 --- /dev/null +++ b/inputs/Lab3.12.in @@ -0,0 +1,12 @@ +11 3 3 0 +1.0 2 +1.1 1 +1.2 1 +1.3 1 +1.4 1 +1.5 2 +1.6 2 +1.7 2 +1.8 2 +1.9 2 +2.15 1 diff --git a/inputs/Lab3.13.in b/inputs/Lab3.13.in new file mode 100755 index 0000000..1293d3c --- /dev/null +++ b/inputs/Lab3.13.in @@ -0,0 +1,12 @@ +11 3 3 0 +1.0 2 +1.1 1 +1.2 1 +1.3 1 +1.4 1 +1.5 2 +1.6 2 +1.7 2 +1.8 2 +1.9 2 +2.25 1 diff --git a/inputs/Lab3.14.in b/inputs/Lab3.14.in new file mode 100755 index 0000000..d956817 --- /dev/null +++ b/inputs/Lab3.14.in @@ -0,0 +1,13 @@ +12 3 2 2 +1.0 2 +1.1 2 +1.2 2 +1.3 2 +1.4 2 +1.5 2 +1.6 2 +1.7 2 +1.8 2 +1.9 2 +2.0 2 +2.1 2 diff --git a/inputs/Lab3.15.in b/inputs/Lab3.15.in new file mode 100755 index 0000000..0a7cf4d --- /dev/null +++ b/inputs/Lab3.15.in @@ -0,0 +1,13 @@ +12 3 2 3 +1.0 2 +1.1 3 +1.2 2 +1.3 3 +1.4 2 +1.5 3 +1.6 2 +1.7 3 +1.8 2 +1.9 3 +2.0 2 +2.1 3 diff --git a/inputs/Lab3.2.in b/inputs/Lab3.2.in new file mode 100755 index 0000000..70b721d --- /dev/null +++ b/inputs/Lab3.2.in @@ -0,0 +1,4 @@ +3 1 0 2 +1.1 2.0 +2.2 2.0 +3.3 2.0 diff --git a/inputs/Lab3.3.in b/inputs/Lab3.3.in new file mode 100755 index 0000000..bfd4f7b --- /dev/null +++ b/inputs/Lab3.3.in @@ -0,0 +1,7 @@ +6 1 0 2 +1.1 2 +1.2 2 +1.3 2 +1.4 2 +4.0 2 +5.0 2 diff --git a/inputs/Lab3.4.in b/inputs/Lab3.4.in new file mode 100755 index 0000000..f5d06c8 --- /dev/null +++ b/inputs/Lab3.4.in @@ -0,0 +1,7 @@ +6 1 0 3 +1.1 2 +1.2 2 +1.3 2 +1.4 2 +4.0 2 +5.0 2 diff --git a/inputs/Lab3.5.in b/inputs/Lab3.5.in new file mode 100755 index 0000000..a0e4555 --- /dev/null +++ b/inputs/Lab3.5.in @@ -0,0 +1,5 @@ +4 2 0 1 +1.0 1.0 +1.1 1.0 +2.2 1.0 +2.3 1.0 diff --git a/inputs/Lab3.6.in b/inputs/Lab3.6.in new file mode 100755 index 0000000..5228301 --- /dev/null +++ b/inputs/Lab3.6.in @@ -0,0 +1,5 @@ +4 2 0 2 +1.0 1.0 +1.1 1.0 +2.2 1.0 +2.3 1.0 diff --git a/inputs/Lab3.7.in b/inputs/Lab3.7.in new file mode 100755 index 0000000..864f02a --- /dev/null +++ b/inputs/Lab3.7.in @@ -0,0 +1,4 @@ +3 2 0 1 +1.0 4 +2.1 1 +4.2 1 diff --git a/inputs/Lab3.8.in b/inputs/Lab3.8.in new file mode 100755 index 0000000..4939cd9 --- /dev/null +++ b/inputs/Lab3.8.in @@ -0,0 +1,6 @@ +5 2 0 1 +1.0 1.0 +1.2 1.0 +1.4 1.0 +1.6 1.0 +2.1 1.0 diff --git a/inputs/Lab3.9.in b/inputs/Lab3.9.in new file mode 100755 index 0000000..16bcd76 --- /dev/null +++ b/inputs/Lab3.9.in @@ -0,0 +1,6 @@ +5 2 0 2 +1.0 1.0 +1.2 1.0 +1.4 1.0 +1.6 1.0 +2.1 1.0 diff --git a/outputs/ArrayTest.out b/outputs/ArrayTest.out new file mode 100755 index 0000000..a65cf82 --- /dev/null +++ b/outputs/ArrayTest.out @@ -0,0 +1,55 @@ +jshell> /open Array.java +jshell> Integer i +jshell> String s +jshell> Array a; +jshell> a = new Array(4); +jshell> a.set(0, 3); +jshell> a.set(1, 6); +jshell> a.set(2, 4); +jshell> a.set(3, 1); +jshell> a.set(0, "huat"); +| Error: +| incompatible types: java.lang.String cannot be converted to java.lang.Integer +| a.set(0, "huat"); +| ^----^ +jshell> i = a.get(0) +jshell> i +i ==> 3 +jshell> i = a.get(1) +jshell> i +i ==> 6 +jshell> i = a.get(2) +jshell> i +i ==> 4 +jshell> i = a.get(3) +jshell> i +i ==> 1 +jshell> s = a.get(0) +| Error: +| incompatible types: java.lang.Integer cannot be converted to java.lang.String +| s = a.get(0) +| ^------^ +jshell> i = a.min() +jshell> i +i ==> 1 +jshell> a.set(3,9); +jshell> i = a.min() +jshell> i +i ==> 3 +jshell> // try something not comparable +jshell> class A {} +jshell> Array a; +| Error: +| type argument A is not within bounds of type-variable T +| Array a; +| ^ +jshell> class A implements Comparable { public int compareTo(Long i) { return 0; } } +jshell> Array a; +| Error: +| type argument A is not within bounds of type-variable T +| Array a; +| ^ +jshell> // try something comparable +jshell> class A implements Comparable { public int compareTo(A a) { return 0; } } +jshell> Array a; +jshell> \ No newline at end of file diff --git a/outputs/Lab3.1.out b/outputs/Lab3.1.out new file mode 100755 index 0000000..4392835 --- /dev/null +++ b/outputs/Lab3.1.out @@ -0,0 +1,12 @@ +1.000: C0 arrived [ ] +1.000: C0 service begin (by S0 [ ]) +2.000: C0 service done (by S0 [ ]) +2.000: C0 departed +3.000: C1 arrived [ ] +3.000: C1 service begin (by S0 [ ]) +4.000: C1 service done (by S0 [ ]) +4.000: C1 departed +5.000: C2 arrived [ ] +5.000: C2 service begin (by S0 [ ]) +6.000: C2 service done (by S0 [ ]) +6.000: C2 departed diff --git a/outputs/Lab3.10.out b/outputs/Lab3.10.out new file mode 100755 index 0000000..cdad552 --- /dev/null +++ b/outputs/Lab3.10.out @@ -0,0 +1,20 @@ +1.000: C0 arrived [ ] +1.000: C0 service begin (by S0 [ ]) +1.200: C1 arrived [ ] +1.200: C1 service begin (by S1 [ ]) +1.400: C2 arrived [ ] +1.400: C2 joined shop queue [ ] +1.600: C3 arrived [ C2 ] +1.600: C3 joined shop queue [ C2 ] +2.100: C4 arrived [ C2 C3 ] +2.100: C4 departed +2.200: C1 service done (by S1 [ ]) +2.200: C1 departed +2.200: C2 service begin (by S1 [ ]) +2.500: C0 service done (by S0 [ ]) +2.500: C0 departed +2.500: C3 service begin (by S0 [ ]) +3.200: C2 service done (by S1 [ ]) +3.200: C2 departed +3.500: C3 service done (by S0 [ ]) +3.500: C3 departed diff --git a/outputs/Lab3.11.out b/outputs/Lab3.11.out new file mode 100755 index 0000000..bea7a03 --- /dev/null +++ b/outputs/Lab3.11.out @@ -0,0 +1,18 @@ +1.000: C0 arrived [ ] +1.000: C0 service begin (by S0 [ ]) +1.100: C1 arrived [ ] +1.100: C1 joined counter queue (at S0 [ ]) +1.200: C2 arrived [ ] +1.200: C2 joined counter queue (at S0 [ C1 ]) +1.300: C3 arrived [ ] +1.300: C3 departed +1.400: C4 arrived [ ] +1.400: C4 departed +2.000: C0 service done (by S0 [ C1 C2 ]) +2.000: C0 departed +2.000: C1 service begin (by S0 [ C2 ]) +3.000: C1 service done (by S0 [ C2 ]) +3.000: C1 departed +3.000: C2 service begin (by S0 [ ]) +4.000: C2 service done (by S0 [ ]) +4.000: C2 departed diff --git a/outputs/Lab3.12.out b/outputs/Lab3.12.out new file mode 100755 index 0000000..41dbf2e --- /dev/null +++ b/outputs/Lab3.12.out @@ -0,0 +1,52 @@ +1.000: C0 arrived [ ] +1.000: C0 service begin (by S0 [ ]) +1.100: C1 arrived [ ] +1.100: C1 service begin (by S1 [ ]) +1.200: C2 arrived [ ] +1.200: C2 service begin (by S2 [ ]) +1.300: C3 arrived [ ] +1.300: C3 joined counter queue (at S0 [ ]) +1.400: C4 arrived [ ] +1.400: C4 joined counter queue (at S1 [ ]) +1.500: C5 arrived [ ] +1.500: C5 joined counter queue (at S2 [ ]) +1.600: C6 arrived [ ] +1.600: C6 joined counter queue (at S0 [ C3 ]) +1.700: C7 arrived [ ] +1.700: C7 joined counter queue (at S1 [ C4 ]) +1.800: C8 arrived [ ] +1.800: C8 joined counter queue (at S2 [ C5 ]) +1.900: C9 arrived [ ] +1.900: C9 joined counter queue (at S0 [ C3 C6 ]) +2.100: C1 service done (by S1 [ C4 C7 ]) +2.100: C1 departed +2.100: C4 service begin (by S1 [ C7 ]) +2.150: C10 arrived [ ] +2.150: C10 joined counter queue (at S1 [ C7 ]) +2.200: C2 service done (by S2 [ C5 C8 ]) +2.200: C2 departed +2.200: C5 service begin (by S2 [ C8 ]) +3.000: C0 service done (by S0 [ C3 C6 C9 ]) +3.000: C0 departed +3.000: C3 service begin (by S0 [ C6 C9 ]) +3.100: C4 service done (by S1 [ C7 C10 ]) +3.100: C4 departed +3.100: C7 service begin (by S1 [ C10 ]) +4.000: C3 service done (by S0 [ C6 C9 ]) +4.000: C3 departed +4.000: C6 service begin (by S0 [ C9 ]) +4.200: C5 service done (by S2 [ C8 ]) +4.200: C5 departed +4.200: C8 service begin (by S2 [ ]) +5.100: C7 service done (by S1 [ C10 ]) +5.100: C7 departed +5.100: C10 service begin (by S1 [ ]) +6.000: C6 service done (by S0 [ C9 ]) +6.000: C6 departed +6.000: C9 service begin (by S0 [ ]) +6.100: C10 service done (by S1 [ ]) +6.100: C10 departed +6.200: C8 service done (by S2 [ ]) +6.200: C8 departed +8.000: C9 service done (by S0 [ ]) +8.000: C9 departed diff --git a/outputs/Lab3.13.out b/outputs/Lab3.13.out new file mode 100755 index 0000000..ab0ed03 --- /dev/null +++ b/outputs/Lab3.13.out @@ -0,0 +1,52 @@ +1.000: C0 arrived [ ] +1.000: C0 service begin (by S0 [ ]) +1.100: C1 arrived [ ] +1.100: C1 service begin (by S1 [ ]) +1.200: C2 arrived [ ] +1.200: C2 service begin (by S2 [ ]) +1.300: C3 arrived [ ] +1.300: C3 joined counter queue (at S0 [ ]) +1.400: C4 arrived [ ] +1.400: C4 joined counter queue (at S1 [ ]) +1.500: C5 arrived [ ] +1.500: C5 joined counter queue (at S2 [ ]) +1.600: C6 arrived [ ] +1.600: C6 joined counter queue (at S0 [ C3 ]) +1.700: C7 arrived [ ] +1.700: C7 joined counter queue (at S1 [ C4 ]) +1.800: C8 arrived [ ] +1.800: C8 joined counter queue (at S2 [ C5 ]) +1.900: C9 arrived [ ] +1.900: C9 joined counter queue (at S0 [ C3 C6 ]) +2.100: C1 service done (by S1 [ C4 C7 ]) +2.100: C1 departed +2.100: C4 service begin (by S1 [ C7 ]) +2.200: C2 service done (by S2 [ C5 C8 ]) +2.200: C2 departed +2.200: C5 service begin (by S2 [ C8 ]) +2.250: C10 arrived [ ] +2.250: C10 joined counter queue (at S1 [ C7 ]) +3.000: C0 service done (by S0 [ C3 C6 C9 ]) +3.000: C0 departed +3.000: C3 service begin (by S0 [ C6 C9 ]) +3.100: C4 service done (by S1 [ C7 C10 ]) +3.100: C4 departed +3.100: C7 service begin (by S1 [ C10 ]) +4.000: C3 service done (by S0 [ C6 C9 ]) +4.000: C3 departed +4.000: C6 service begin (by S0 [ C9 ]) +4.200: C5 service done (by S2 [ C8 ]) +4.200: C5 departed +4.200: C8 service begin (by S2 [ ]) +5.100: C7 service done (by S1 [ C10 ]) +5.100: C7 departed +5.100: C10 service begin (by S1 [ ]) +6.000: C6 service done (by S0 [ C9 ]) +6.000: C6 departed +6.000: C9 service begin (by S0 [ ]) +6.100: C10 service done (by S1 [ ]) +6.100: C10 departed +6.200: C8 service done (by S2 [ ]) +6.200: C8 departed +8.000: C9 service done (by S0 [ ]) +8.000: C9 departed diff --git a/outputs/Lab3.14.out b/outputs/Lab3.14.out new file mode 100755 index 0000000..6d1acb1 --- /dev/null +++ b/outputs/Lab3.14.out @@ -0,0 +1,56 @@ +1.000: C0 arrived [ ] +1.000: C0 service begin (by S0 [ ]) +1.100: C1 arrived [ ] +1.100: C1 service begin (by S1 [ ]) +1.200: C2 arrived [ ] +1.200: C2 service begin (by S2 [ ]) +1.300: C3 arrived [ ] +1.300: C3 joined counter queue (at S0 [ ]) +1.400: C4 arrived [ ] +1.400: C4 joined counter queue (at S1 [ ]) +1.500: C5 arrived [ ] +1.500: C5 joined counter queue (at S2 [ ]) +1.600: C6 arrived [ ] +1.600: C6 joined counter queue (at S0 [ C3 ]) +1.700: C7 arrived [ ] +1.700: C7 joined counter queue (at S1 [ C4 ]) +1.800: C8 arrived [ ] +1.800: C8 joined counter queue (at S2 [ C5 ]) +1.900: C9 arrived [ ] +1.900: C9 joined shop queue [ ] +2.000: C10 arrived [ C9 ] +2.000: C10 joined shop queue [ C9 ] +2.100: C11 arrived [ C9 C10 ] +2.100: C11 departed +3.000: C0 service done (by S0 [ C3 C6 ]) +3.000: C0 departed +3.000: C9 joined counter queue (at S0 [ C6 ]) +3.000: C3 service begin (by S0 [ C6 C9 ]) +3.100: C1 service done (by S1 [ C4 C7 ]) +3.100: C1 departed +3.100: C10 joined counter queue (at S1 [ C7 ]) +3.100: C4 service begin (by S1 [ C7 C10 ]) +3.200: C2 service done (by S2 [ C5 C8 ]) +3.200: C2 departed +3.200: C5 service begin (by S2 [ C8 ]) +5.000: C3 service done (by S0 [ C6 C9 ]) +5.000: C3 departed +5.000: C6 service begin (by S0 [ C9 ]) +5.100: C4 service done (by S1 [ C7 C10 ]) +5.100: C4 departed +5.100: C7 service begin (by S1 [ C10 ]) +5.200: C5 service done (by S2 [ C8 ]) +5.200: C5 departed +5.200: C8 service begin (by S2 [ ]) +7.000: C6 service done (by S0 [ C9 ]) +7.000: C6 departed +7.000: C9 service begin (by S0 [ ]) +7.100: C7 service done (by S1 [ C10 ]) +7.100: C7 departed +7.100: C10 service begin (by S1 [ ]) +7.200: C8 service done (by S2 [ ]) +7.200: C8 departed +9.000: C9 service done (by S0 [ ]) +9.000: C9 departed +9.100: C10 service done (by S1 [ ]) +9.100: C10 departed diff --git a/outputs/Lab3.15.out b/outputs/Lab3.15.out new file mode 100755 index 0000000..d3389fc --- /dev/null +++ b/outputs/Lab3.15.out @@ -0,0 +1,60 @@ +1.000: C0 arrived [ ] +1.000: C0 service begin (by S0 [ ]) +1.100: C1 arrived [ ] +1.100: C1 service begin (by S1 [ ]) +1.200: C2 arrived [ ] +1.200: C2 service begin (by S2 [ ]) +1.300: C3 arrived [ ] +1.300: C3 joined counter queue (at S0 [ ]) +1.400: C4 arrived [ ] +1.400: C4 joined counter queue (at S1 [ ]) +1.500: C5 arrived [ ] +1.500: C5 joined counter queue (at S2 [ ]) +1.600: C6 arrived [ ] +1.600: C6 joined counter queue (at S0 [ C3 ]) +1.700: C7 arrived [ ] +1.700: C7 joined counter queue (at S1 [ C4 ]) +1.800: C8 arrived [ ] +1.800: C8 joined counter queue (at S2 [ C5 ]) +1.900: C9 arrived [ ] +1.900: C9 joined shop queue [ ] +2.000: C10 arrived [ C9 ] +2.000: C10 joined shop queue [ C9 ] +2.100: C11 arrived [ C9 C10 ] +2.100: C11 joined shop queue [ C9 C10 ] +3.000: C0 service done (by S0 [ C3 C6 ]) +3.000: C0 departed +3.000: C9 joined counter queue (at S0 [ C6 ]) +3.000: C3 service begin (by S0 [ C6 C9 ]) +3.200: C2 service done (by S2 [ C5 C8 ]) +3.200: C2 departed +3.200: C10 joined counter queue (at S2 [ C8 ]) +3.200: C5 service begin (by S2 [ C8 C10 ]) +4.100: C1 service done (by S1 [ C4 C7 ]) +4.100: C1 departed +4.100: C11 joined counter queue (at S1 [ C7 ]) +4.100: C4 service begin (by S1 [ C7 C11 ]) +6.000: C3 service done (by S0 [ C6 C9 ]) +6.000: C3 departed +6.000: C6 service begin (by S0 [ C9 ]) +6.100: C4 service done (by S1 [ C7 C11 ]) +6.100: C4 departed +6.100: C7 service begin (by S1 [ C11 ]) +6.200: C5 service done (by S2 [ C8 C10 ]) +6.200: C5 departed +6.200: C8 service begin (by S2 [ C10 ]) +8.000: C6 service done (by S0 [ C9 ]) +8.000: C6 departed +8.000: C9 service begin (by S0 [ ]) +8.200: C8 service done (by S2 [ C10 ]) +8.200: C8 departed +8.200: C10 service begin (by S2 [ ]) +9.100: C7 service done (by S1 [ C11 ]) +9.100: C7 departed +9.100: C11 service begin (by S1 [ ]) +10.200: C10 service done (by S2 [ ]) +10.200: C10 departed +11.000: C9 service done (by S0 [ ]) +11.000: C9 departed +12.100: C11 service done (by S1 [ ]) +12.100: C11 departed diff --git a/outputs/Lab3.2.out b/outputs/Lab3.2.out new file mode 100755 index 0000000..1c18769 --- /dev/null +++ b/outputs/Lab3.2.out @@ -0,0 +1,14 @@ +1.100: C0 arrived [ ] +1.100: C0 service begin (by S0 [ ]) +2.200: C1 arrived [ ] +2.200: C1 joined shop queue [ ] +3.100: C0 service done (by S0 [ ]) +3.100: C0 departed +3.100: C1 service begin (by S0 [ ]) +3.300: C2 arrived [ ] +3.300: C2 joined shop queue [ ] +5.100: C1 service done (by S0 [ ]) +5.100: C1 departed +5.100: C2 service begin (by S0 [ ]) +7.100: C2 service done (by S0 [ ]) +7.100: C2 departed diff --git a/outputs/Lab3.3.out b/outputs/Lab3.3.out new file mode 100755 index 0000000..7e87ce5 --- /dev/null +++ b/outputs/Lab3.3.out @@ -0,0 +1,23 @@ +1.100: C0 arrived [ ] +1.100: C0 service begin (by S0 [ ]) +1.200: C1 arrived [ ] +1.200: C1 joined shop queue [ ] +1.300: C2 arrived [ C1 ] +1.300: C2 joined shop queue [ C1 ] +1.400: C3 arrived [ C1 C2 ] +1.400: C3 departed +3.100: C0 service done (by S0 [ ]) +3.100: C0 departed +3.100: C1 service begin (by S0 [ ]) +4.000: C4 arrived [ C2 ] +4.000: C4 joined shop queue [ C2 ] +5.000: C5 arrived [ C2 C4 ] +5.000: C5 departed +5.100: C1 service done (by S0 [ ]) +5.100: C1 departed +5.100: C2 service begin (by S0 [ ]) +7.100: C2 service done (by S0 [ ]) +7.100: C2 departed +7.100: C4 service begin (by S0 [ ]) +9.100: C4 service done (by S0 [ ]) +9.100: C4 departed diff --git a/outputs/Lab3.4.out b/outputs/Lab3.4.out new file mode 100755 index 0000000..7a1f6ef --- /dev/null +++ b/outputs/Lab3.4.out @@ -0,0 +1,26 @@ +1.100: C0 arrived [ ] +1.100: C0 service begin (by S0 [ ]) +1.200: C1 arrived [ ] +1.200: C1 joined shop queue [ ] +1.300: C2 arrived [ C1 ] +1.300: C2 joined shop queue [ C1 ] +1.400: C3 arrived [ C1 C2 ] +1.400: C3 joined shop queue [ C1 C2 ] +3.100: C0 service done (by S0 [ ]) +3.100: C0 departed +3.100: C1 service begin (by S0 [ ]) +4.000: C4 arrived [ C2 C3 ] +4.000: C4 joined shop queue [ C2 C3 ] +5.000: C5 arrived [ C2 C3 C4 ] +5.000: C5 departed +5.100: C1 service done (by S0 [ ]) +5.100: C1 departed +5.100: C2 service begin (by S0 [ ]) +7.100: C2 service done (by S0 [ ]) +7.100: C2 departed +7.100: C3 service begin (by S0 [ ]) +9.100: C3 service done (by S0 [ ]) +9.100: C3 departed +9.100: C4 service begin (by S0 [ ]) +11.100: C4 service done (by S0 [ ]) +11.100: C4 departed diff --git a/outputs/Lab3.5.out b/outputs/Lab3.5.out new file mode 100755 index 0000000..f867ffc --- /dev/null +++ b/outputs/Lab3.5.out @@ -0,0 +1,16 @@ +1.000: C0 arrived [ ] +1.000: C0 service begin (by S0 [ ]) +1.100: C1 arrived [ ] +1.100: C1 service begin (by S1 [ ]) +2.000: C0 service done (by S0 [ ]) +2.000: C0 departed +2.100: C1 service done (by S1 [ ]) +2.100: C1 departed +2.200: C2 arrived [ ] +2.200: C2 service begin (by S0 [ ]) +2.300: C3 arrived [ ] +2.300: C3 service begin (by S1 [ ]) +3.200: C2 service done (by S0 [ ]) +3.200: C2 departed +3.300: C3 service done (by S1 [ ]) +3.300: C3 departed diff --git a/outputs/Lab3.6.out b/outputs/Lab3.6.out new file mode 100755 index 0000000..f867ffc --- /dev/null +++ b/outputs/Lab3.6.out @@ -0,0 +1,16 @@ +1.000: C0 arrived [ ] +1.000: C0 service begin (by S0 [ ]) +1.100: C1 arrived [ ] +1.100: C1 service begin (by S1 [ ]) +2.000: C0 service done (by S0 [ ]) +2.000: C0 departed +2.100: C1 service done (by S1 [ ]) +2.100: C1 departed +2.200: C2 arrived [ ] +2.200: C2 service begin (by S0 [ ]) +2.300: C3 arrived [ ] +2.300: C3 service begin (by S1 [ ]) +3.200: C2 service done (by S0 [ ]) +3.200: C2 departed +3.300: C3 service done (by S1 [ ]) +3.300: C3 departed diff --git a/outputs/Lab3.7.out b/outputs/Lab3.7.out new file mode 100755 index 0000000..5f8c849 --- /dev/null +++ b/outputs/Lab3.7.out @@ -0,0 +1,12 @@ +1.000: C0 arrived [ ] +1.000: C0 service begin (by S0 [ ]) +2.100: C1 arrived [ ] +2.100: C1 service begin (by S1 [ ]) +3.100: C1 service done (by S1 [ ]) +3.100: C1 departed +4.200: C2 arrived [ ] +4.200: C2 service begin (by S1 [ ]) +5.000: C0 service done (by S0 [ ]) +5.000: C0 departed +5.200: C2 service done (by S1 [ ]) +5.200: C2 departed diff --git a/outputs/Lab3.8.out b/outputs/Lab3.8.out new file mode 100755 index 0000000..07a65c2 --- /dev/null +++ b/outputs/Lab3.8.out @@ -0,0 +1,20 @@ +1.000: C0 arrived [ ] +1.000: C0 service begin (by S0 [ ]) +1.200: C1 arrived [ ] +1.200: C1 service begin (by S1 [ ]) +1.400: C2 arrived [ ] +1.400: C2 joined shop queue [ ] +1.600: C3 arrived [ C2 ] +1.600: C3 departed +2.000: C0 service done (by S0 [ ]) +2.000: C0 departed +2.000: C2 service begin (by S0 [ ]) +2.100: C4 arrived [ ] +2.100: C4 joined shop queue [ ] +2.200: C1 service done (by S1 [ ]) +2.200: C1 departed +2.200: C4 service begin (by S1 [ ]) +3.000: C2 service done (by S0 [ ]) +3.000: C2 departed +3.200: C4 service done (by S1 [ ]) +3.200: C4 departed diff --git a/outputs/Lab3.9.out b/outputs/Lab3.9.out new file mode 100755 index 0000000..c21659e --- /dev/null +++ b/outputs/Lab3.9.out @@ -0,0 +1,23 @@ +1.000: C0 arrived [ ] +1.000: C0 service begin (by S0 [ ]) +1.200: C1 arrived [ ] +1.200: C1 service begin (by S1 [ ]) +1.400: C2 arrived [ ] +1.400: C2 joined shop queue [ ] +1.600: C3 arrived [ C2 ] +1.600: C3 joined shop queue [ C2 ] +2.000: C0 service done (by S0 [ ]) +2.000: C0 departed +2.000: C2 service begin (by S0 [ ]) +2.100: C4 arrived [ C3 ] +2.100: C4 joined shop queue [ C3 ] +2.200: C1 service done (by S1 [ ]) +2.200: C1 departed +2.200: C3 service begin (by S1 [ ]) +3.000: C2 service done (by S0 [ ]) +3.000: C2 departed +3.000: C4 service begin (by S0 [ ]) +3.200: C3 service done (by S1 [ ]) +3.200: C3 departed +4.000: C4 service done (by S0 [ ]) +4.000: C4 departed diff --git a/outputs/QueueTest.out b/outputs/QueueTest.out new file mode 100755 index 0000000..f1fd47c --- /dev/null +++ b/outputs/QueueTest.out @@ -0,0 +1,34 @@ +jshell> /open Queue.java +jshell> Integer i; +jshell> String s; +jshell> boolean b; +jshell> Queue q = new Queue(2); +jshell> b = q.enq(4); +jshell> b +b ==> true +jshell> b = q.enq(8); +jshell> b +b ==> true +jshell> b = q.enq(0); +jshell> b +b ==> false +jshell> s = q.deq(); +| Error: +| incompatible types: java.lang.Integer cannot be converted to java.lang.String +| s = q.deq(); +| ^-----^ +jshell> i = q.deq(); +jshell> i +i ==> 4 +jshell> i = q.deq(); +jshell> i +i ==> 8 +jshell> i = q.deq(); +jshell> i +i ==> null +jshell> q.enq("hello"); +| Error: +| incompatible types: java.lang.String cannot be converted to java.lang.Integer +| q.enq("hello"); +| ^-----^ +jshell> \ No newline at end of file