⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 twotasksnet.java

📁 Rakiura JFern是一个非常轻型的带有模拟器的Petri网络框架
💻 JAVA
字号:
// This is copyrighted source file, part of Rakiura JFern package. // See the file LICENSE for copyright information and the terms and conditions// for copying, distributing and modifications of Rakiura JFern package.// Copyright (C) 1999-2002 by Mariusz Nowostawski and others  [http://www.rakiura.org]package org.rakiura.cpn.sample;/**/import java.util.List;import org.rakiura.cpn.*;import org.rakiura.cpn.lib.Sequence;/** * Simple example of two sequencial tasks. *  *<br><br> * TwoTasksNet.java<br> * Created: Tue Oct  3 16:53:15 2000<br> * *@author  <a href="mariusz@rakiura.org">Mariusz Nowostawski</a> *@version 2.1.0 $Revision: 1.7 $ */public class TwoTasksNet extends Sequence {    public TwoTasksNet() {    final List l = transitions();    final Transition t1 =  (Transition) l.get(0);    final OutputArc out1 = (OutputArc) t1.outputArcs().get(0);    out1.setExpression(out1.new Expression() {        public Multiset evaluate() {          final Multiset out = new Multiset();          Object t = getMultiset().getAny();          int n = ((Number) t).intValue();          out.add(new Integer(n + 1));          return out;        }      });    final Transition t2 =  (Transition) l.get(1);    final OutputArc out2 = (OutputArc) t2.outputArcs().get(0);    out2.setExpression(out2.new Expression() {        public Multiset evaluate() {          int n = ((Number) getMultiset().getAny()).intValue();          return new Multiset(new Integer(n + 1));        }      });  }    public TwoTasksNet(Multiset m) {    this();    inputPlace().addTokens(m);  }    } // TwoTasksNet//////////////////// end of file ////////////////////

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -