10.05.2013 Views

Texto base de la asignatura - UNED

Texto base de la asignatura - UNED

Texto base de la asignatura - UNED

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

C<strong>la</strong>se siso<br />

DEVSJAVA<br />

La c<strong>la</strong>se siso restringe Deltext <strong>de</strong> modo que espere un único evento <strong>de</strong> entrada<br />

en cada instante. La función <strong>de</strong> transición externa <strong>de</strong>be ser escrita por el usuario <strong>de</strong><br />

<strong>la</strong> c<strong>la</strong>se empleando el método Deltext(double e, double input).<br />

package SimpArc;<br />

import genDevs.mo<strong>de</strong>ling.*;<br />

import GenCol.*;<br />

public c<strong>la</strong>ss siso extends c<strong>la</strong>ssic {<br />

}<br />

public void AddTestPortValue(double input){<br />

addTestInput("in",new doubleEnt((double)input));<br />

}<br />

public siso(String name){<br />

super(name);<br />

AddTestPortValue(0);<br />

}<br />

public void Deltext(double e, double input) {<br />

} // Función <strong>de</strong> transición externa <strong>de</strong> <strong>la</strong> c<strong>la</strong>se siso<br />

public void Deltext(double e, content con) {<br />

// Función <strong>de</strong> transición externa que espera <strong>la</strong> c<strong>la</strong>se c<strong>la</strong>ssic<br />

doubleEnt fe = (doubleEnt)con.getValue();<br />

Deltext(e,fe.getv());<br />

}<br />

public double sisoOut(){<br />

// Un evento <strong>de</strong> salida en cada instante. Evento <strong>de</strong> valor real<br />

return 0;<br />

}<br />

public message out() {<br />

message m = new message();<br />

content con = makeContent("out",new doubleEnt(sisoOut()));<br />

m.add(con);<br />

return m;<br />

}<br />

287

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!