Changes between Version 15 and Version 16 of Tutorials
- Timestamp:
- 09/12/13 11:02:43 (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Tutorials
v15 v16 191 191 The last two only contain the Sender (the submodel w) of the simple example. 192 192 193 1. Modify src/java/examples/simplesubmodel/ConsoleWriter.javaso that it sends a193 1. Modify `src/java/examples/simplesubmodel/ConsoleWriter.java` so that it sends a 194 194 message back to Sender.java; modify Sender.java to receive this message. In 195 195 this example, call both the sending and the receiving port "messages", for … … 205 205 **Spoiler:** 206 206 207 * In ConsoleWriter.java207 * In `ConsoleWriter.java` 208 208 * create the method `protected void intermediateObservation()` 209 209 * send some data over it in `execute()` by adding … … 212 212 out("messages").send(msg); 213 213 }}} 214 * In Sender.java214 * In `Sender.java` 215 215 * Create the method `protected void solvingStep()` 216 216 * Receive the data … … 227 227 * Append the lines 228 228 {{{ 229 cs.attach('r' => 'w') { 230 tie('messages', 'messages') 231 } 229 r.couple(w, {'messages' => 'messages'}) 232 230 }}} 233 231 * Since the names of the ports are equal (`messages`), you can also use the abbreviated form: 234 232 {{{ 235 cs.attach('r' => 'w') { 236 tie('messages') 237 } 233 r.couple(w, 'messages') 238 234 }}} 239 235 * Build it and execute … … 268 264 * Change the line 269 265 {{{ 270 cxa.add_kernel('r', 'examples.simplejava.ConsoleWriter')266 r = Instance.new('r', 'examples.simplejava.ConsoleWriter') 271 267 }}} 272 268 to 273 269 {{{ 274 cxa.add_kernel('r', 'examples.simplesubmodel.ConsoleWriter')270 r = Instance.new('r', 'examples.simplesubmodel.ConsoleWriter') 275 271 }}} 276 272 277 273 * Append the lines 278 274 {{{ 279 cs.attach('r' => 'w') { 280 tie('messages') 281 } 275 r.couple(w, 'messages') 282 276 }}} 283 277 … … 286 280 287 281 For MAPPER partners, visit the [[MAPPER tutorial]]. 282 For MAPPER partners, visit the [[MAPPER tutorial]].