• 大小: 2.8MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-20
  • 语言: 其他
  • 标签: uppaal  tron  

资源简介

Uppaal TRON 是一种基于Uppaal engine的在线测试工具, 它适用于对实时系统(主要是对实时嵌入式软件)的黑盒一致性测试,。本文介绍了Uppaal TRON的构成、特征以及优缺点,语法, 语义和语用, 列举了它的几种扩展形式, 并归纳了其应用及研究现状.

资源截图

代码片段和文件信息

package smartlamp;

import java.awt.frame;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.MouseListener;
import java.awt.event.MouseEvent;
import java.awt.event.WindowListener;
import java.awt.event.WindowEvent;

import java.io.IOException;
import java.util.linkedList;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.Condition;

import tron.*;

public class AutoOffLightController extends VirtualThread
    implements MouseListener WindowListener LevelListener
{
    /**
     * Controls whether the debug information should be produced into err
     * stream. true enables and false disables debug output.
     * This variable can be set via environment variable DEBUG_AUTOOFF.
     */
    public static boolean DBG = (System.getenv(“DEBUG_AUTOOFF“)!=null);

    private enum Loc { Off On };
    private Loc location;

    boolean alive = false;

    long startTime;
    long aTime; //time of activation

    Dimmer dimmer = null;

    Lock lock = null;
    Condition cond = null;

    final int mutant levelCount;
    final int Tsw=2000; //2 seconds

    Reporter reporter = null;// sends output
    TestInputHandler testInputHandler = null;// receives input via reporter

    public AutoOffLightController(int mutant int levelCount)
    {
super(“AutoOffLightController“);
assert(levelCount>0);
location = Loc.Off;
this.mutant = mutant;
this.levelCount = levelCount;
testInputHandler = new TestInputHandler();
reporter = new Reporter(testInputHandler 9999);
//Dimmer is only used to manage graphics easily
dimmer = new Dimmer(aTime levelCount mutant);
dimmer.addLevelListener(this);
dimmer.start();
    }

    public void run()
    {
// wait for dimmer to initialize:
try { synchronized(dimmer) { while (!dimmer.alive) dimmer.wait(); }}
catch(InterruptedException e){ System.err.println(e); System.exit(1);}

lock = new VirtualLock(“LCLock“);
cond = lock.newCondition();
lock.lock();
// notify that LC is ready:
synchronized (this) { alive = true; notifyAll(); }

System.out.println(“AutoOff Init: “+location);
aTime = getTimeMillis();
while (alive) {
    System.out.println(“AutoOff State: “+location);
    switch (location) {
    case Off:
try { cond.await(); }
catch(InterruptedException e) { alive = false; }
//do  nothing
break;
    case On:
System.out.println(“AutoOff before wait: “+location);
boolean stillWaiting=true;
try { stillWaiting=cond.await(Tsw TimeUnit.MILLISECONDS); }
catch(InterruptedException e) { alive = false; }
System.out.println(“AutoOff after cond.wait: “+location);
if(stillWaiting){
    //the light was touched before time out
    //so just wait for a fresh interval
} else {
    if (location == Loc.On) {
dimmer.setLevel(0);
location=Loc.Off;
    }
}
break;
    default:
alive = false;
    }
}
System.out.println(“IFace interrupted in “+location);
dimmer.interrupt();
reporter.d

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2008-04-14 15:14  uppaal-tron-1.4b5-win32\
     目录           0  2008-04-14 15:14  uppaal-tron-1.4b5-win32\compressor\
     文件        1020  2008-04-14 15:14  uppaal-tron-1.4b5-win32\compressor\emulateCompressor.trc
     文件         192  2008-04-14 15:14  uppaal-tron-1.4b5-win32\compressor\monitorCompressor.trc
     文件         209  2008-04-14 15:14  uppaal-tron-1.4b5-win32\compressor\simpleCompressor.trc
     文件          78  2008-04-14 15:14  uppaal-tron-1.4b5-win32\compressor\simpleCompressor.trn
     文件       10443  2008-04-14 15:14  uppaal-tron-1.4b5-win32\compressor\simpleCompressor.xml
     文件         207  2008-04-14 15:14  uppaal-tron-1.4b5-win32\compressor\swapCompressor.trc
     文件          78  2008-04-14 15:14  uppaal-tron-1.4b5-win32\compressor\swapCompressor.trn
     目录           0  2008-04-14 15:14  uppaal-tron-1.4b5-win32\include\
     文件        1210  2008-04-14 15:14  uppaal-tron-1.4b5-win32\include\console.h
     文件        1650  2008-04-14 15:14  uppaal-tron-1.4b5-win32\include\dialog.h
     文件        1765  2008-04-14 15:14  uppaal-tron-1.4b5-win32\include\sampleadapter.h
     文件        8561  2008-04-14 15:14  uppaal-tron-1.4b5-win32\include\tcpcomm.h
     目录           0  2008-04-14 15:14  uppaal-tron-1.4b5-win32\include\tron\
     文件        3427  2008-04-14 15:14  uppaal-tron-1.4b5-win32\include\tron\adapter.h
     文件        3739  2008-04-14 15:14  uppaal-tron-1.4b5-win32\include\tron\Executable.h
     文件        2930  2008-04-14 15:14  uppaal-tron-1.4b5-win32\include\tron\sockets.h
     文件        4398  2008-04-14 15:14  uppaal-tron-1.4b5-win32\include\tron\timeutil.h
     文件        3154  2008-04-14 15:14  uppaal-tron-1.4b5-win32\include\tron\timing.h
     文件        7220  2008-04-14 15:14  uppaal-tron-1.4b5-win32\include\troncodec.h
     目录           0  2008-04-14 15:14  uppaal-tron-1.4b5-win32\java\
     文件        3580  2008-04-14 15:14  uppaal-tron-1.4b5-win32\java\autoOffLight.xml
     目录           0  2008-04-14 15:14  uppaal-tron-1.4b5-win32\java\doc\
     文件        1987  2008-04-14 15:14  uppaal-tron-1.4b5-win32\java\doc\allclasses-frame.html
     文件        1727  2008-04-14 15:14  uppaal-tron-1.4b5-win32\java\doc\allclasses-noframe.html
     文件        8467  2008-04-14 15:14  uppaal-tron-1.4b5-win32\java\doc\constant-values.html
     文件        4960  2008-04-14 15:14  uppaal-tron-1.4b5-win32\java\doc\deprecated-list.html
     文件        9059  2008-04-14 15:14  uppaal-tron-1.4b5-win32\java\doc\help-doc.html
     文件       44878  2008-04-14 15:14  uppaal-tron-1.4b5-win32\java\doc\index-all.html
     文件        1342  2008-04-14 15:14  uppaal-tron-1.4b5-win32\java\doc\index.html
............此处省略153个文件信息

评论

共有 条评论