Changes between Version 15 and Version 16 of Tutorials

Show
Ignore:
Timestamp:
09/12/13 11:02:43 (11 years ago)
Author:
jorisborgdorff
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Tutorials

    v15 v16  
    191191The last two only contain the Sender (the submodel w) of the simple example. 
    192192 
    193 1. Modify src/java/examples/simplesubmodel/ConsoleWriter.java so that it sends a 
     1931. Modify `src/java/examples/simplesubmodel/ConsoleWriter.java` so that it sends a 
    194194message back to Sender.java; modify Sender.java to receive this message. In 
    195195this example, call both the sending and the receiving port "messages", for 
     
    205205**Spoiler:** 
    206206 
    207 * In ConsoleWriter.java 
     207* In `ConsoleWriter.java` 
    208208 * create the method `protected void intermediateObservation()`   
    209209 * send some data over it in `execute()` by adding 
     
    212212    out("messages").send(msg); 
    213213  }}} 
    214 * In Sender.java 
     214* In `Sender.java` 
    215215 * Create the method `protected void solvingStep()` 
    216216 * Receive the data 
     
    227227 * Append the lines 
    228228  {{{ 
    229    cs.attach('r' => 'w') { 
    230     tie('messages', 'messages') 
    231    } 
     229   r.couple(w, {'messages' => 'messages'}) 
    232230  }}} 
    233231 * Since the names of the ports are equal (`messages`), you can also use the abbreviated form: 
    234232  {{{ 
    235    cs.attach('r' => 'w') { 
    236     tie('messages') 
    237    } 
     233   r.couple(w, 'messages') 
    238234  }}} 
    239235* Build it and execute 
     
    268264 * Change the line 
    269265  {{{ 
    270    cxa.add_kernel('r', 'examples.simplejava.ConsoleWriter') 
     266   r = Instance.new('r', 'examples.simplejava.ConsoleWriter') 
    271267  }}} 
    272268  to 
    273269  {{{ 
    274    cxa.add_kernel('r', 'examples.simplesubmodel.ConsoleWriter') 
     270   r = Instance.new('r', 'examples.simplesubmodel.ConsoleWriter') 
    275271  }}} 
    276272  
    277273 * Append the lines 
    278274  {{{ 
    279    cs.attach('r' => 'w') { 
    280     tie('messages') 
    281    } 
     275   r.couple(w, 'messages') 
    282276  }}} 
    283277 
     
    286280 
    287281For MAPPER partners, visit the [[MAPPER tutorial]]. 
     282For MAPPER partners, visit the [[MAPPER tutorial]].