MàJ par récupération sur Clé USB et dans /mnt/hd/Chargement du pc portable

This commit is contained in:
olivier
2008-12-02 23:56:33 +01:00
parent 3e719157ea
commit 5b95264a14
196 changed files with 12561 additions and 10316 deletions

View File

@ -0,0 +1,7 @@
class Bonjour { // essai de hello world
public static void main (String[] args) {
System.out.println ("Bonjour !");
}
}

View File

@ -0,0 +1,11 @@
import iutsud.Console;
class BonjourToi1{ // essai d'entr<74>e-sortie caractere avec le package iutsud
public static void main (String[] args) {
String nom;int an;
System.out.print ("tapez votre nom : ");
nom=Console.readLine();
System.out.print ("tapez votre annee de naissance : ");
an=Console.readInt();
System.out.println ("Bonjour "+nom+" ! Vous avez "+(2007-an)+" ans");
}
}

View File

@ -0,0 +1,15 @@
import javax.swing.JOptionPane;
import java.util.Calendar;
class BonjourToi2 { // essai de hello world avec une entree et une sortie Swing
public static void main (String[] args) {
String nom,ch;
int an,anneeCourante;
anneeCourante=Calendar.getInstance().get(Calendar.YEAR);
nom=JOptionPane.showInputDialog("taper votre nom ");
ch=JOptionPane.showInputDialog("taper votre annee de naissance (4chiffres)");
System.out.println("nom="+nom+"; naiss="+ch+"; annee courante : "+anneeCourante);
an=Integer.parseInt(ch);
JOptionPane.showMessageDialog(null,"Bonjour "+nom+"! Vous avez "+(anneeCourante-an)+"ans");
System.exit(0);
}
}

View File

@ -0,0 +1,13 @@
public class InverseArgs {
public static void main (String[] args) {
int longr;
longr=args.length;
if (longr==0)
System.out.println ("il n'y a pas d'arguments !");
else System.out.println("nb d'args :"+longr);
for (int i =longr-1 ; i>=0; i--) {
System.out.print(" "+args[i]);
}
System.out.println();
}
}

View File

@ -0,0 +1,26 @@
import javax.swing.JOptionPane;
class Premier { // Determine si un nb est premier ou non
public static void main (String[] args) {
String nb,reponse ;
int n;
boolean premier;
nb=JOptionPane.showInputDialog("tapez votre nombre");
n=Integer.parseInt(nb);
while (n!=0) {
premier = true;
if (n==1) {JOptionPane.showMessageDialog(null,"1 n'est pas premier par convention ");
premier=false;}
for (int i=2;i<n; i++) {
System.out.println(n+" "+i+" "+n%i);
if (n%i==0) {
JOptionPane.showMessageDialog(null,n+" n'est pas premier :multiple de "+ i);
premier=false;
break;}
}
if (premier)JOptionPane.showMessageDialog(null,n+" est un nb premier ");
nb=JOptionPane.showInputDialog("tapez votre nombre");
n=Integer.parseInt(nb);
}
System.exit(0);
}
}

View File

@ -0,0 +1,25 @@
import iutsud.Console;
/** calcul de x puissance y avec un algorithme basique !*/
class Puissance{ // calcul de x puissance y avec un algorithme basique
public static void main (String[] args) {
int x,y,p;
System.out.println ("Calcul de x puissance y");
System.out.print ("tapez la valeur de x : ");
x=Console.readInt();
System.out.print ("tapez la valeur de y : ");
y=Console.readInt();
if (y==0)
if (x==0)
System.out.println("0 puissance 0 est indefini");
else System.out.println(x+ " puissance 0 = 1");
else {
p=1;
for (int i=0;i<y;i++) {
p=p*x;
}
System.out.println(x+ " puissance "+y +" ="+ p);
}
}
}

View File

@ -0,0 +1,17 @@
public class SommeEntiers {
public static void main (String args[]) {
int longr=args.length;
switch (longr){
case 0 : System.out.println("Eh banane, t'as oublie les arguments !!!");
break;
case 1 : System.out.println("Quoi, seulement un arg ? "+args[0]);
default :
int somme=0;
for (int i=0 ; i<args.length ; i++) {
int j=Integer.parseInt(args[i]);
somme+=j;
}
System.out.println("somme : "+somme);
}
}
}

View File

@ -0,0 +1,262 @@
/** Java class "Adherent.java" generated from Poseidon for UML.
* Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
* Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
*/
package adherents;
import java.util.*;
/**
* <p>
*
* </p>
*/
public class Adherent {
///////////////////////////////////////
// attributes
/**
* <p>
* Represents ...
* </p>
*/
private int numeroAdherent;
/**
* <p>
* Represents ...
* </p>
*/
private String nom;
/**
* <p>
* Represents ...
* </p>
*/
private String ville;
/**
* <p>
* Represents ...
* </p>
*/
private int anneeNaissance;
/**
* <p>
* Represente le montant de la cotisation (commun &#224; tous les adherents)
* </p>
*
*/
private static int c_montantCotisation=45;
/**
* <p>
* Represente le montant actuellement verse par l'adherent
* </p>
*
*/
private int cotisationVersee;
///////////////////////////////////////
// operations
/**
* <p>
* Does ...
* </p><p>
*
* @return a String with ...
* </p>
*/
public String getNom() {
// your code here
return this.nom;
} // end getNom
/**
* <p>
* Represents ...
* </p>
*/
public int getNumeroAdh() {
return this.numeroAdherent;
} // end getNumeroAdh
/**
* <p>
* Does ...
* </p><p>
*
* @return a int with ...
* </p>
*/
public int getAge() {
// your code here
return 2005-anneeNaissance;
} // end getAge
/**
* <p>
* Represents ...
* </p>
*/
public int getCotisationVersee() {
return cotisationVersee;
} // end getCotisationVersee
/**
* <p>
*
* @return a boolean : l'adherent est ou non &#224; jour de cotisation
* </p>
*/
public boolean aJour() {
// your code here
if (cotisationVersee>=c_montantCotisation)
return true;
else
return false;
} // end aJour
/**
* <p>
* Ajoute la somme passee en param au montant de la cotisation versee
* </p>
* <p>
*
* @return a boolean qui dit si l'adherent est a jour apres ce versement
* </p>
* <p>
* @param versement montant de la somme versee
* </p>
*/
public boolean cotiser(int versement) {
// your code here
cotisationVersee+=versement;
return aJour();
} // end cotiser
/**
* <p>
*
* @return a String : &quot;A jour&quot; ou &quot; PAS A JOUR !!!&quot;
* </p>
*/
public String etat() {
// your code here
String etat;
if (this.aJour()) etat = "a jour"; else etat = "PAS A JOUR !!!";
return etat;
} // end etat
/**
* <p>
* Does ...
* </p><p>
*
* @return a String with ...
* </p>
*/
public String toString() {
// your code here
return (getNumeroAdh()+" "+getNom()+" "+getVille()+" "+getAge()+" ans : a cotise : "+getCotisationVersee()+" "+etat());
} // end toString
/**
* <p>
* Does ...
* </p><p>
*
* </p><p>
*
* @param args ...
* </p>
*/
public static void main(String[] args) {
// your code here
Adherent a1=new Adherent(1,"Dupont","Paris",1980);
Adherent a2=new Adherent(2,"Meyer","Strasbourg",1955);
Adherent a3=new Adherent(3,"Legwenn","Brest",1960);
System.out.println (a1);
System.out.println (a2);
System.out.println (a3);
System.out.println ();
a1.cotiser(45);
System.out.println (a1);
System.out.println (a2);
System.out.println (a3);
System.out.println ();
a2.cotiser(30);
System.out.println (a1);
System.out.println (a2);
System.out.println (a3);
System.out.println ();
a3.cotiser(40);
System.out.println (a1);
System.out.println (a2);
System.out.println (a3);
System.out.println ();
a2.cotiser(15);
System.out.println (a1);
System.out.println (a2);
System.out.println (a3);
} // end main
/**
* <p>
* Constructeur d'Adherent
* </p>
* <p>
*
* @return a Adherent
* </p>
* <p>
* @param num ...
* </p>
* <p>
* @param nom ...
* </p>
* <p>
* @param vil ...
* </p>
* <p>
* @param nss ...
* </p>
*/
public Adherent(int num, String nom, String vil, int nss) {
// your code here
this.numeroAdherent=num;
this.nom=nom;
this.ville=vil;
this.anneeNaissance=nss;
} // end Adherent
/**
* <p>
* Represents ...
* </p>
*/
public String getVille() {
return ville;
} // end getVille
/**
* <p>
* Represents ...
* </p>
*/
public void setVille(String _ville) {
ville = _ville;
} // end setVille
} // end Adherent

View File

@ -0,0 +1,66 @@
/** Java class "Gerant.java" generated from Poseidon for UML.
* Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
* Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
*/
package adherents;
import adherents.Adherent;
import java.util.*;
/**
* <p>
*
* </p>
*/
class Gerant {
///////////////////////////////////////
// operations
/**
* <p>
* Does ...
* </p><p>
*
* </p><p>
*
* @param args ...
* </p>
*/
public static void main(String[] args) {
// your code here
Adherent a1=new Adherent(1,"Dupont","Paris",1980);
Adherent a2=new Adherent(2,"Meyer","Strasbourg",1955);
Adherent a3=new Adherent(3,"Legwenn","Brest",1960);
System.out.println (a1);
System.out.println (a2);
System.out.println (a3);
System.out.println ();
a1.cotiser(45);
System.out.println (a1);
System.out.println (a2);
System.out.println (a3);
System.out.println ();
a2.cotiser(30);
System.out.println (a1);
System.out.println (a2);
System.out.println (a3);
System.out.println ();
a3.cotiser(40);
System.out.println (a1);
System.out.println (a2);
System.out.println (a3);
System.out.println ();
a2.cotiser(15);
System.out.println (a1);
System.out.println (a2);
System.out.println (a3);
} // end main
} // end Gerant

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

View File

@ -0,0 +1,263 @@
/** Java class "Adherent.java" generated from Poseidon for UML.
* Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
* Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
*/
package Pack_adherents;
import java.util.*;
/**
* <p>
*
* </p>
*/
public class Adherent {
///////////////////////////////////////
// attributes
/**
* <p>
* Represents ...
* </p>
*/
private int numeroAdherent;
/**
* <p>
* Represents ...
* </p>
*/
private String nom;
/**
* <p>
* Represents ...
* </p>
*/
private String ville;
/**
* <p>
* Represents ...
* </p>
*/
private int anneeNaissance;
/**
* <p>
* Represente le montant de la cotisation (commun &#224; tous les adherents)
* </p>
*
*/
private static int c_montantCotisation=45;
/**
* <p>
* Represente le montant actuellement verse par l'adherent
* </p>
*
*/
private int cotisationVersee;
///////////////////////////////////////
// operations
/**
* <p>
* Does ...
* </p><p>
*
* @return a String with ...
* </p>
*/
public String getNom() {
// your code here
return this.nom;
} // end getNom
/**
* <p>
* Represents ...
* </p>
*/
public int getNumeroAdh() {
return this.numeroAdherent;
} // end getNumeroAdh
/**
* <p>
* Does ...
* </p><p>
*
* @return a int with ...
* </p>
*/
public int getAge() {
// your code here
return 2005-anneeNaissance;
} // end getAge
/**
* <p>
* Represents ...
* </p>
*/
public int getCotisationVersee() {
return cotisationVersee;
} // end getCotisationVersee
/**
* <p>
*
* @return a boolean : l'adherent est ou non &#224; jour de cotisation
* </p>
*/
public boolean aJour() {
// your code here
if (cotisationVersee>=c_montantCotisation)
return true;
else
return false;
} // end aJour
/**
* <p>
* Ajoute la somme passee en param au montant de la cotisation versee
* </p>
* <p>
*
* @return a boolean qui dit si l'adherent est a jour apres ce versement
* </p>
* <p>
* @param versement montant de la somme versee
* </p>
*/
public boolean cotiser(int versement) {
// your code here
cotisationVersee+=versement;
return aJour();
} // end cotiser
/**
* <p>
*
* @return a String : &quot;A jour&quot; ou &quot; PAS A JOUR !!!&quot;
* </p>
*/
public String etat() {
// your code here
String etat;
if (this.aJour()) etat = "a jour"; else etat = "PAS A JOUR !!!";
return etat;
} // end etat
/**
* <p>
* Does ...
* </p><p>
*
* @return a String with ...
* </p>
*/
public String toString() {
// your code here
return (getNumeroAdh()+" "+getNom()+" "+getVille()+" "+getAge()+" ans : a cotise : "+getCotisationVersee()+" "+etat());
} // end toString
/**
* <p>
* Does ...
* </p><p>
*
* </p><p>
*
* @param args ...
* </p>
*/
public static void main(String[] args) {
// your code here
Adherent a1=new Adherent(1,"Dupont","Paris",1980);
Adherent a2=new Adherent(2,"Meyer","Strasbourg",1955);
Adherent a3=new Adherent(3,"Legwenn","Brest",1960);
System.out.println (a1);
System.out.println (a2);
System.out.println (a3);
System.out.println ();
a1.cotiser(45);
System.out.println (a1);
System.out.println (a2);
System.out.println (a3);
System.out.println ();
a2.cotiser(30);
System.out.println (a1);
System.out.println (a2);
System.out.println (a3);
System.out.println ();
a3.cotiser(40);
System.out.println (a1);
System.out.println (a2);
System.out.println (a3);
System.out.println ();
a2.cotiser(15);
System.out.println (a1);
System.out.println (a2);
System.out.println (a3);
} // end main
/**
* <p>
* Constructeur d'Adherent
* </p>
* <p>
*
* @return a Adherent
* </p>
* <p>
* @param num ...
* </p>
* <p>
* @param nom ...
* </p>
* <p>
* @param vil ...
* </p>
* <p>
* @param nss ...
* </p>
*/
public Adherent(int num, String nom, String vil, int nss) {
// your code here
this.numeroAdherent=num;
this.nom=nom;
this.ville=vil;
this.anneeNaissance=nss;
} // end Adherent
/**
* <p>
* Represents ...
* </p>
*/
public String getVille() {
return ville;
} // end getVille
/**
* <p>
* Represents ...
* </p>
*/
public void setVille(String _ville) {
ville = _ville;
} // end setVille
} // end Adherent

View File

@ -0,0 +1,134 @@
/** Java class "Gerant.java" generated from Poseidon for UML.
* Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
* Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
*/
package Pack_adherents;
import java.util.*;
/**
* <p>
*
* </p>
*/
class Gerant {
///////////////////////////////////////
// attributes
/**
* <p>
*
* </p>
*/
public static Collection adherent = new Vector();
///////////////////////////////////////
// operations
/**
* <p>
* Does ...
* </p><p>
*
* </p><p>
*
*
*
* @param args ...
* </p>
*/
public static void main(String[] args) {
Adherent a1=new Adherent(1,"Dupont","Paris",1980);
addAdherent(a1);
Adherent a2=new Adherent(2,"Meyer","Strasbourg",1955);
addAdherent(a2);
Adherent a3=new Adherent(3,"Legwenn","Brest",1960);
addAdherent(a3);
for (int i=0;i<adherent.size();i++){
Vector v=(Vector)getAdherents();
Adherent a=(Adherent)v.elementAt(i);
System.out.println (a);
}
System.out.println ();
a1.cotiser(45);
for (int i=0;i<adherent.size();i++){
Vector v=(Vector)getAdherents();
Adherent a=(Adherent)v.elementAt(i);
System.out.println (a);
}
System.out.println ();
a2.cotiser(30);
for (int i=0;i<adherent.size();i++){
Vector v=(Vector)getAdherents();
Adherent a=(Adherent)v.elementAt(i);
System.out.println (a);
}
System.out.println ();
a3.cotiser(40);
for (int i=0;i<adherent.size();i++){
Vector v=(Vector)getAdherents();
Adherent a=(Adherent)v.elementAt(i);
System.out.println (a);
}
System.out.println ();
a2.cotiser(15);
for (int i=0;i<adherent.size();i++){
Vector v=(Vector)getAdherents();
Adherent a=(Adherent)v.elementAt(i);
System.out.println (a);
}
} // end main
/**
* <p>
* Does ...
* </p><p>
*
* @return a Collection with ...
* </p>
*/
public static Collection getAdherents() {
return adherent;
} // end getAdherents
/**
* <p>
* Does ...
* </p><p>
*
* </p><p>
*
* @param adherent ...
* </p>
*/
public static void addAdherent(Adherent adherent) {
if (! Gerant.adherent.contains(adherent)) Gerant.adherent.add(adherent);
} // end addAdherent
/**
* <p>
* Does ...
* </p><p>
*
* </p><p>
*
* @param adherent ...
* </p>
*/
public static void removeAdherent(Adherent adherent) {
Gerant.adherent.remove(adherent);
} // end removeAdherent
} // end Gerant

View File

@ -0,0 +1,21 @@
public class Femme extends Personne {
///////////////////////////////////////
// attributes
private String nomjf;
///////////////////////////////////////
// operations
public Femme(String nom,int an, String njf) {
super(nom,an);
this.nomjf = njf;
} // end constructeur
public String toString(){
return super.toString()+" nee "+nomjf;
}
} // end Femme

View File

@ -0,0 +1,54 @@
/** Java class "Personne.java"
Repr<EFBFBD>sente une personne quelconque
*/
import java.util.*;
public class Personne {
///////////////////////////////////////
// attributes
private String nom;
private int anneeNaiss;
///////////////////////////////////////
// operations
public String getNom() {
return nom;
}
public void setNom(String _nom) {
nom = _nom;
}
/**
* <p>
* Constructeur de Personne
* </p><p>
*
* @return a Personne * </p><p>
* @param i identifiant
* </p> <p>
* @param n nom
* </p>
*/
public Personne(String n,int an) {
this.nom=n;
this.anneeNaiss=an;
}
public String toString() {
return nom+" "+anneeNaiss;
}
public static void main (String args[]) {
Personne p1 = new Personne("Dupont", 1964);
Personne p2 = new Personne("Dulac", 1983);
Personne p3 = new Femme("Mme Dupont", 1972,"Durand");
System.out.println (p1);
System.out.println (p2);
System.out.println (p3);
}
} // end Personne

View File

@ -0,0 +1,79 @@
public class Confiture {
// Attributs
private String cuisinier, parfum;
private int annee;
private int id;
private static int c_nextId=1;
// Constructeur
public Confiture ( String parfum, String cuisinier,int an ) {
this.parfum = parfum;
this.cuisinier = cuisinier;
this.annee = an;
this.id=c_nextId++;
}
// Accesseurs
public String getCuisinier() {
return this.cuisinier;
}
public String getParfum() {
return this.parfum;
}
public int getAnnee() {
return this.annee;
}
// Modificateurs
public void setAnnee( int annee ) {
if ( annee >= 0 )
this.annee = annee;
else
System.err.println( "Attention ! l'ann<6E>e entr<74>e n'est pas valide" );
}
public void setCuisinier( String cuisinier ) {
this.cuisinier = cuisinier;
}
public void setParfum( String parfum ) {
this.parfum = parfum;
}
// M<>thode d'affichage
public String toString() {
StringBuffer infos = new StringBuffer(" ");
infos.append(this.id);
infos.append(" : Confiture de ").append(this.parfum);
infos.append(" par ").append(this.cuisinier);
infos.append(" (").append(this.annee).append(")");
String res=new String(infos);
return res;
}
public static void main( String args[] ) {
// Creation des deux confitures
Confiture conf1 = new Confiture("fraise","Maman",2007 );
Confiture conf2 = new Confiture("framboise","Moi",2006 );
Confiture conf3 = new Confiture("cassis","Meme",2003 );
// Modification d'une ann<6E>e
conf2.setAnnee( 2005 );
// Affichage des cuisiniers
System.out.println( "Cuisinier confiture 1 : " + conf1.getCuisinier() );
System.out.println( "Cuisinier confiture 2 : " + conf2.getCuisinier() );
// Affichage des informations sur la confiture par la m<>thode println
System.out.println( conf1 );
System.out.println( conf2 );
System.out.println( conf3 );
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View File

@ -0,0 +1,249 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Language" content="fr">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>ROBOT-2</title>
</head>
<body>
<span style="font-family: Arial;">
<h1>La guerre des robots<br>
</h1>
<h2>Solution :&nbsp;</h2>
<h3>Diagramme de classes d'analyse</h3>
<p><img style="border: 0px solid ;" alt="DCA Robot" src="RoboA.jpg"></p>
Quelques remarques :
<br>
<ul>
<li>On pourrait
regrouper en une
seule classe Equipe et Base puisqu'elles sont en relation 1--1 ; les
concepts &eacute;tant diff&eacute;rents, j'ai toutefois choisi
de les
s&eacute;parer, cela permettrait une r&eacute;utilisation plus
rapide
si on d&eacute;cidait qu'une &eacute;quipe peut avoir plusieurs
bases</li>
<li><font face="Arial">La couleur est maintenant
un attribut de
l'&eacute;quipe (cf &eacute;nonc&eacute;)<br>
</font></li>
<li><font face="Arial">get_distancePerception est
abstraite dans
Robot et red&eacute;finie dans les sous-classes car la distance de
perception n'est connue que ds ces sous-classes ; au contraire,
"percevoir" est concr&egrave;te dans Robot car on peut y produire
tout
l'algorithme en faisant appel &agrave; getDistancePerception, elle
retourne un Vector d'Objets des objets per&ccedil;us (Obstacles,
robots, bases)</font></li>
<li><font face="Arial">getCouleur&nbsp; est
concr&egrave;te dans
"Robot" puisque son algorithme ne d&eacute;pend pas des
sous-classes,
il ne d&eacute;pend que de l'&eacute;quipe ( =
getEquipe().getCouleur()&nbsp; ) ; en revanche, elle est abstraite
dans
Objet &agrave; cause de Obstacle<br>
</font></li>
<li><font face="Arial">Comme d'habitude, les
attributs communs
&agrave; toutes les instances d'une classe sont
pr&eacute;fix&eacute;s&nbsp; c_ et static
(soulign&eacute;)&nbsp;</font></li>
<li><font face="Arial">La classe Simulation est un
singleton car elle
n'a qu'une instance (le jeu en cours) et toutes ses
op&eacute;rations
sont collectives<br>
</font></li>
<li><font face="Arial">recevoirTir est une
op&eacute;ration abstraite
de Objet qui est red&eacute;finie dans tous les types d'objets
susceptibles de recevoir des tirs de foreuses ; son algorithme devra
d&eacute;tailler ce qui se passe alors (p.ex.
d&eacute;cr&eacute;menter
la solidit&eacute; d'une valeur proportionnelle &agrave; la
puissance
du tir, mais on pourrait aussi complexifier le jeu en tirant
al&eacute;atoirement une avarie comme par ex. diminuer la distance
de
perception ou la charge max ). RQ : L'&eacute;nonc&eacute; ne
dit rien
du tir sur une base : on pourrait la red&eacute;finir en une
op&eacute;ration vide.</font></li>
<li><font face="Arial">"ajouter un nouveau robot"
donne naissance
&agrave; 2 m&eacute;thodes diff&eacute;rentes selon qu'il
s'agit d'une
foreuse ou d'un porteur (les param&egrave;tres sont
diff&eacute;rents
aussi)</font></li>
</ul>
<h3>Conception :</h3>
<ul>
<li>Faites le diagramme de conception, ajoutez une classe "IHM"
qui
servira d'interface entre l'utilisateur et le syst&egrave;me</li>
</ul>
<p><font face="Arial">
Quelques remarques :&nbsp;</font></p>
<ul>
<li><font face="Arial">Rappel : Dans un DCC les
relations sans
fl&egrave;ches sont des relations bi-orient&eacute;es</font></li>
<li><font face="Arial">Alors qu'un diagramme
d'analyse
pr&eacute;sente peu de variations possibles,&nbsp; il y a
souvent,&nbsp; au contraire, de nombreux choix de conception
possibles
avec des avantages et des inconv&eacute;nients : Ici par exemple,
on
pourrait choisir de mettre un gestionnaire d'instances sur chaque type
d'objet : obstacle, &eacute;quipe, chaque &eacute;quipe
g&eacute;rant
les instances de ses robots, ("Base" &eacute;tant li&eacute;e
&agrave;
"&Eacute;quipe" en 1..1 elle n'a pas absolument besoin d'une
gestion
propre), ceci conduit &agrave; orienter les relations des
gestionnaires
vers leurs objets.</font></li>
</ul>
<p><img src="roboC_autre.jpg" border="0" height="437" width="915"></p>
<ul>
<li><font face="Arial">Je n'ai pas retenu cette
solution, j'ai choisi
de faire de "Simulation" un super-gestionnaire d'instances de tous les
objets car c'est lui de toutes fa&ccedil;ons qui devra "donner vie"
&agrave; chaque objet en fonction de son type et qui devra
d&eacute;cider du type d'objet qui se trouve en (x,y) lors de la
perception par exemple (d'o&ugrave; le "getType" abstrait de
"Objet") <br>
</font></li>
<li><font face="Arial">Les relations sont
orient&eacute;es dans le
sens strictement n&eacute;cessaire pour une bonne
r&eacute;utilisation
p.ex : orienter de Base vers Equipe et non l'inverse permet
d'&eacute;voluer facilement vers une solution "plusieurs bases par
&eacute;quipe"<br>
</font></li>
</ul>
<p><img src="RoboC.jpg" border="0" height="735" width="915"></p>
&nbsp;
<ul>
<li>Faites un diagramme de s&eacute;quences (cf chapitre 4)
pour
chacune des requ&ecirc;tes suivantes :
<ul>
<li>Recharger d'une quantit&eacute; e les batteries du
robot
N&deg;7 de l'&eacute;quipe "rouge" </li>
</ul>
<p>NB : Les 3 param&egrave;tres de la requ&ecirc;te
sont :&nbsp;
num&eacute;ro et couleur du robot consid&eacute;r&eacute;
et
&eacute;nergie &agrave; recharger mais sur le diagramme de
s&eacute;quence, tous les param&egrave;tres apparaissent
toujours comme
"x"&nbsp;</p>
<p><img src="DSeq1.jpg" border="0" height="714" width="749"></p>
<p>&nbsp; </p>
<ul>
<li>Quel est le type (foreuse ou porteur),
l'&eacute;quipe et le
niveau d'&eacute;nergie du robot situ&eacute; en x,y ? (on
supposera
qu'il n'y en a qu'un)</li>
</ul>
<p><img src="DSeq2.jpg" border="0" height="794" width="707"></p>
<p>&nbsp; </p>
<ul>
<li>Ajouter un nouveau robot &agrave;&nbsp; la
simulation (avec
ses param&egrave;tres de construction), on supposera qu'il s'agit
d'un
porteur</li>
</ul>
<p><img src="DSeq3.jpg" border="0" height="674" width="1082"></p>
&nbsp; </li>
<li>Afficher l'&eacute;quipe gagnante : son nom, sa
couleur, sa
quantit&eacute; de minerai et le nombre de foreuses qui y sont
rattach&eacute;es</li>
</ul>
<p><img src="DSeq4.jpg" border="0" height="794" width="790"></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</span>
</body>
</html>