Java et Mascopt. Jean-François Lalande, Michel Syska, Yann Verhoeven. Projet Mascotte, I3S-INRIA Sophia-Antipolis, France

Similar documents
Mascopt. Table of contents

Classes internes, Classes locales, Classes anonymes

VLANs. Commutation LAN et Wireless Chapitre 3

UE 2I002 (ex LI230) : éléments de programmation par objets avec Java TD10 - Exceptions

Graphs and Networks The (, D) problem

Collections. Collections. USTL routier 1

Diverse Routing with the star property

TD : Compilateur ml2java semaine 3

Introduction to Programming Using Java (98-388)

SunVTS Quick Reference Card

Collections version 1.4

Sun StorEdge Network 2 Gb Brocade SilkWorm 3200, 3800, and Core Fabric Switches Guide to Documentation, 3.x / Firmware

CSC 1214: Object-Oriented Programming

Sun Java System Directory Server Release Notes for HP-UX

Conception Orientée Objet. Romain Rouvoy Licence mention Informatique Université Lille 1

SunVTS Quick Reference Card

Sun Control Station. Performance Module. Sun Microsystems, Inc. Part No September 2003, Revision A

TP 2 : Application SnapTchat 20 février 2015

Sun Fire TM E2900 Systems Getting Started

PROGRAMMING FUNDAMENTALS

Sun Java System Connector for Microsoft Outlook Q4 Installation Guide

About Transferring License Rights for. PL7 V4.5 and Unity Pro V2.3 SP1 Software

Solaris 8 6/00 Sun Hardware Roadmap

COMP 110/L Lecture 13. Kyle Dewey

Sun Management Center 3.5 Supplement for VSP High-End Entry Servers (Workgroup Servers)

INFO Object-Oriented Programming

ILLUSTRATION DES EXCEPTIONS

Solaris 9 9/04 Installation Roadmap

Input from Files. Buffered Reader

Voir ces deux articles : [3]

Solaris 8 User Supplement. Sun Microsystems, Inc. 901 San Antonio Road Palo Alto, CA U.S.A.

Sun Management Center 4.0 Version 3 Add-On Software Release Notes

Java Programming with Eclipse

Formation. Application Server Description du cours

CSCI 136 Written Exam #1 Fundamentals of Computer Science II Spring 2014

Héritage (2) Programmation Orientée Objet. Jean-Christophe Routier Licence mention Informatique Université Lille Sciences et Technologies

Solaris PC NetLink 1.2 Installation Guide

CSC Java Programming, Fall Java Data Types and Control Constructs

Sun Fire V100 Server Product Notes

Workflow Concepts and Techniques

Java Desktop System Release 2 Installation Guide

Sun Ultra TM. 5 and Ultra 10 Product Notes. Sun Microsystems, Inc. 901 San Antonio Road Palo Alto, CA U.S.A.

C212 Early Evaluation Exam Mon Feb Name: Please provide brief (common sense) justifications with your answers below.

Solaris 8 User Supplement. Sun Microsystems, Inc. 901 San Antonio Road Palo Alto, CA U.S.A.

(A) 99 (B) 100 (C) 101 (D) 100 initial integers plus any additional integers required during program execution

CIS 265 Exam 2 First Name Last Name

IBM MQ version CD

Sun Management Center 4.0 Version 4 Add-On Software Release Notes

Real-Time Java: LAB #2 RealTime Threads: Scheduling & Release Models

Routing Reconfiguration/Process Number: Networks with Shared Bandwidth.

Solaris 8 Desktop User Supplement. Sun Microsystems, Inc. 901 San Antonio Road Palo Alto, CA U.S.A.

ELIESER : USER MANUAL

Getting started with Java

Sun Management Center 3.6 Version 7 Add-On Software Release Notes

Sun Fire X4250 Volume Configuration Guide

Patron: Visitor(Visiteur) TSP - June 2013 Patrons de Conception J Paul Gibson Visitor.1

Sun Management Center 3.5 Service Availability Manager User s Guide

Sun Java System Access Manager Release Notes for Microsoft Windows

man pages section 6: Demos

Java: Comment Text. Introduction. Concepts

Java 1.8 Programming

Lecture Notes CPSC 224 (Spring 2012) Today... Java basics. S. Bowers 1 of 8

Java Intro 3. Java Intro 3. Class Libraries and the Java API. Outline

Algorithmes certifiants

MODULE 6q - Exceptions

TD 2. Correction TP info

WDR Installation Guide

System Controller CPU Board, Netra CompactPCI, Installation Guide. Sun Fire E25K/E20K Systems Sun Fire 15K/12K Systems

An overview of Java, Data types and variables

ControlLogix Redundant Power Supply Chassis Adapter Module

Solaris 8 Desktop User Supplement

(A) 99 ** (B) 100 (C) 101 (D) 100 initial integers plus any additional integers required during program execution

Lecture 2. COMP1406/1006 (the Java course) Fall M. Jason Hinek Carleton University

Getting It Right COMS W4115. Prof. Stephen A. Edwards Spring 2007 Columbia University Department of Computer Science

Traditional Chinese Solaris Release Overview

Windows Server 2003 Installation Configuration Et Administration Pdf

PASS4TEST IT 인증시험덤프전문사이트

Chapitre 6 Programmation orientée aspect (AOP)

Oracle ZFS Storage Appliance Cabling Guide. For ZS3-x, 7x20 Controllers, and DE2-24, Sun Disk Shelves

QUIZ 2 Introduction to Computer Science (COMP 250) Mon. March 2, 2009 Professor Michael Langer

Font Administrator User s Guide. Sun Microsystems, Inc. 901 San Antonio Road Palo Alto, CA U.S.A.

Sequence structure. The computer executes java statements one after the other in the order in which they are written. Total = total +grade;

SunPCi Release Notes

Java Desktop System Release 3 Troubleshooting Guide

TD4 Design Pattern, Utilisation de l'api Java - Corrigé. Exercice 1 Gestion d'une base de client

Question1 (10 points) : Patron Aggregator

CSE 201 JAVA PROGRAMMING I. Copyright 2016 by Smart Coding School

5. Enterprise JavaBeans 5.3 Entity Beans. Entity Beans

Overview of Java s Support for Polymorphism

TP 3 des architectures logicielles Séance 3 : Architecture n-tiers distribuée à base d EJB. 1 Préparation de l environnement Eclipse

Programming Basics. Digital Urban Visualization. People as Flows. ia

Canada s Energy Future:

READ ME FIRST QUICK INSTALL GUIDE. Wireless Controller XWC Includes: One: XWC-1000 Wireless Controller One: Rack Mount Kit One: Power Cord

Introduction to Java

Forte for Java (Community Edition) QuickStart Guide

Midterm I - CSE11 Fall 2013 CLOSED BOOK, CLOSED NOTES 50 minutes, 100 points Total.

Sun Ultra 2 UltraSPARC -IIModuleX-Option

UltraSPARC - IIs CPU Module Installation Guide

Programming II (CS300)

Transcription:

Java et Mascopt Jean-François Lalande, Michel Syska, Yann Verhoeven Projet Mascotte, IS-INRIA Sophia-Antipolis, France Formation Mascotte 09 janvier 00

Java Java et Mascopt - Formation Mascotte 09 janvier 00

Java - Compiler et Exécuter > ls Lancement.java Tutoriel.java > javac Tutoriel.java > javac Lancement.java > ls Lancement.class Lancement.java Tutoriel.class Tutoriel.java > export CLASSPATH=./:$CLASSPATH > java Lancement Nombre de vertex: 0 > cd /net/ailleurs/pas ici/a l autre bout du monde > java Lancement Nombre de vertex: 0 Java et Mascopt - Formation Mascotte 09 janvier 00

class Tutoriel Notion de Classe public int nb vertex = 0; private int nb tutoriel = 0; public void displaynbvertex() System.out.println( Nombre de vertex: + nb vertex); 8 9 0 Java et Mascopt - Formation Mascotte 09 janvier 00

public class Lancement public static void main(string args []) Tutoriel tutoriel = new Tutoriel(); tutoriel.displaynbvertex(); 8 9 0 Java et Mascopt - Formation Mascotte 09 janvier 00

package tutoriel.essai; public class Tutoriel public int nb vertex = 0; private int nb tutoriel = 0; Packages public void displaynbvertex() System.out.println( Nombre de vertex: + nb vertex); 8 9 0 ls tutoriel/essai Tutoriel.java Tutoriel.class Java et Mascopt - Formation Mascotte 09 janvier 00

//import tutoriel.essai. ; import tutoriel.essai.tutoriel; public class Lancement public static void main(string args []) Tutoriel tutoriel = new Tutoriel(); tutoriel.displaynbvertex(); 8 9 0 Java et Mascopt - Formation Mascotte 09 janvier 00

package tutoriel.essai; Constructeur public class Tutoriel public int nb vertex = 0; private int nb tutoriel = 0; public Tutoriel() System.out.println( Je me construits... ); public void displaynbvertex() System.out.println( Nombre de vertex: + nb vertex); 8 9 0 Java et Mascopt - Formation Mascotte 09 janvier 00

if (condition) else while (condition) Structures de controle for(int i=0; i<; i++) System.out.println( i= +i); switch(k) case : System.out.println( Case k= ); break; case : System.out.println( Case k= ); break; default: System.out.println( case default ); Java et Mascopt - Formation Mascotte 09 janvier 00 8

Vector, List, ArrayList Set, HashSet, HashTable Iterateur sur des ensembles Vector v = new Vector(); v.add(new Integer(9)); v.add(new Integer()); Iterator it = v.iterator(); while (v.hasnext()) Integer courant = (Integer)v.next(); System.out.println( courant= + courant); 8 9 0 Java et Mascopt - Formation Mascotte 09 janvier 00 9

Mascopt Java et Mascopt - Formation Mascotte 09 janvier 00 0

Récuperer Mascopt Mascopt par CVS export CVSROOT=cvs sop.inria.fr:/cvs/mascotte export CVS RSH=ssh cvs checkout mascoptdev cd mascoptdev export CVS RSH=ssh cvs d :ext:login@cvs sop.inria.fr:/cvs/mascotte checkout mascoptdev cd mascoptdev Architecture bin which contains scripts which launch applications docs wich contains the documentation files which contains some files of graphs or networks jar which contains the jar files launch which contains the code of applications licences all the licences of each part of provided code Java et Mascopt - Formation Mascotte 09 janvier 00

src which contains the source code of algorithms developed by users. This is the place where you can put the code of your algorithm. samples which contains some samples references of classes of mascopt. tests wich contains bad code of developers, where they test their algorithms Ou aller? toutes les algorithmes (classes) sans main() src/ tous les tests qui utilisent ces algos tests/ quand l algo marche écrire un main() dans samples/ Java et Mascopt - Formation Mascotte 09 janvier 00

mascoptlib Division du code en deux parties mascoptlib gestion des graphes, GUI gestion des entrées sorties algorithmes validés et robustes mascoptdev Espace utilisateurs Tests, algorithmes en développement dans mascoptdev on trouve mascoptlib.jar Java et Mascopt - Formation Mascotte 09 janvier 00

Makefile source SETENV make Compile les classes des utilisateurs (src/...) Compile les mains des utilisateurs (tests/...) Compile les exemples des utilisateurs (samples/...) make javadoc Construit la javadoc de mascoptdev et mascoptlib popotte: /unison/mascopt/mascoptdev> source SETENV popotte: /unison/mascopt/mascoptdev> make make s all log Cplex detected. popotte: /unison/mascopt/mascoptdev>ls classes/... Java et Mascopt - Formation Mascotte 09 janvier 00

Java et Mascopt - Formation Mascotte 09 janvier 00

Vertex n0 = new Vertex(); Vertex n = new Vertex(); Vertex n = new Vertex(); Vertex n = new Vertex(); Vertex n = new Vertex(); Vertex n = new Vertex(); Créér un graphe // creation des arcs entre les neouds Arc a0 = new Arc(n0, n); Arc a = new Arc(n, n); Arc a = new Arc(n, n); Arc a = new Arc(n, n); Arc a = new Arc(n, n); // creation d un ensemble de noeuds V VertexSet V = new VertexSet(); // on ajoue les noeuds ds l ensemble de noeuds V.add(n0); 8 9 0 8 9 Java et Mascopt - Formation Mascotte 09 janvier 00

V.add(n); V.add(n); V.add(n); V.add(n); V.add(n); // creation d un ensemble d arc E ArcSet E = new ArcSet(V); E.add(a0); E.add(a); E.add(a); E.add(a); E.add(a); // cration d un Digraph graph=v,e DiGraph graph = new DiGraph(V, E); // on l affiche sur la sortie standart System.out.println( mon graph = + graph); 0 8 9 0 8 Java et Mascopt - Formation Mascotte 09 janvier 00

Storing/Getting values For storing a String on vertix, arc, node set, edge set, graph: getvalue(string name) setvalue(string name, String value) For storing an Integer on nodes, arcs and graphs: getintegervalue(string name) setintegervalue(string name, Integer value) For storing an int on nodes, arcs and graphs: getintvalue(string name) setintvalue(string name, int value) For storing a Double on nodes, arcs and graphs: getdoublevalue(string name) setdoublevalue(string name, Double value) For storing a double on nodes, arcs and graphs: getdouvalue(string name) setdouvalue(string name, double value) Java et Mascopt - Formation Mascotte 09 janvier 00 8

Exemple: v.setvalue( poids, ); v.getvalue( poids ); v.setintegervalue( poids, new Integer(9)); v.setdouvalue( poids, 8.); Conversions: String s a = ; String s b =. ; String s c =. ; String s d = ; Integer a = new Integer(Integer.parseInt(s a)); double b = Double.parseFloat(s b); Double c = new Double(Double.parseFloat(s c)); int d = Integer.parseInt(s d); 8 Java et Mascopt - Formation Mascotte 09 janvier 00 9

Ensemble et sous-ensemble Remplir un set NodeSet V0 = new NodeSet(); for (int i=0; i<0;i++) V0.add(new Node(Math.random(),Math.random())); System.out.println( V0: + V0); Créér un subset NodeSet V = new NodeSet(V0); System.out.println( V: + V); Synchronisation des subset par rapport au super set Java et Mascopt - Formation Mascotte 09 janvier 00 0

Chemins Construction d un chemin DiGraph g =...; Path p = new Path(g.getEdgeSet()); Arc e =...; Arc e =...; Arc e =...; p.concat(e); p.concat(e); p.concat(e); Parcourir un chemin Vertex current = p.getstart(); while (current!= p.getend()) System.out.println( Current node: + current); 8 9 Java et Mascopt - Formation Mascotte 09 janvier 00

Arc e = p.nextarc(current); System.out.println( Current edge: + e); current = p.nextvertex(current); 8 9 Multi-path Path p =...; Path p =...; boolean ok = p.merge(p); Java et Mascopt - Formation Mascotte 09 janvier 00

Entrées/Sorties try // creation du writer MGLWriter writer = new MGLWriter(args[0]); // on ajoute ce qu on veut ecrire (ici le graph) writer.add(graph); // on pourrai rajouter d autres objets... // on ecrit writer.write(); catch (java.io.filenotfoundexception fe) fe.printstacktrace(); // le tout dans un bloc try catch pq ca peut lancer des exceptions. 8 9 0 Java et Mascopt - Formation Mascotte 09 janvier 00

// on cree le reader. MGLReader mglr = new MGLReader(args[0]); try mglr.parse(); catch (Exception e) System.out.println( Error when parsing file! ); // on recupere un iterateur sur les graphs du fichier Iterator itg = mglr.getabstractgraphs(); while (itg.hasnext()) System.out.println( Graph read = + itg.next()); 8 9 0 Java et Mascopt - Formation Mascotte 09 janvier 00

GraphChooser gc = new GraphChooser(); HashMap my graphs = null; if (args.length < ) my graphs = gc.getgraphhashmapgml(); else my graphs = gc.getgraphhashmapgml(args[0]); DiGraph G = (DiGraph) my graphs.get( graph Cable ); DiGraph R = (DiGraph) my graphs.get( graph Request ); 8 9 0 Java et Mascopt - Formation Mascotte 09 janvier 00

Network files fichier MGL contenant: Graphe nommé graph Request Graphe nommé graph Cable Ces deux graphes partagent l ensemble de nœuds Cette convention risque de changer... Java et Mascopt - Formation Mascotte 09 janvier 00

The God format c Reseau de test: cables c n e 0 e 0 e e 0 c Reseau de test: requetes c r 0 8 r 0 r 0 9 test.graph test.od Java et Mascopt - Formation Mascotte 09 janvier 00

Conversion en mgl odmgl programme dans mascoptdev/bin utilisation: java OdMglLauncher usage: odmgl filein.graph filein.od fileout.mgl [ h] [ help] Try odmgl help for more options. Java et Mascopt - Formation Mascotte 09 janvier 00 8