From 074f65cf4ee21830e63f445472b80ee9422b4509 Mon Sep 17 00:00:00 2001
From: Ludovic Apvrille <ludovic.apvrille@telecom-paristech.fr>
Date: Mon, 8 Feb 2021 19:08:17 +0100
Subject: [PATCH] Update on attack tree analysis

---
 src/main/java/attacktrees/Attack.java         |   8 +-
 src/main/java/attacktrees/AttackNode.java     |  16 +-
 src/main/java/attacktrees/AttackTree.java     |  64 +-
 src/main/java/attacktrees/AttackerGroup.java  |  16 +-
 .../java/attacktrees/AttackerPopulation.java  |  33 +-
 src/main/java/attacktrees/ORNode.java         |  20 +-
 src/main/java/attacktrees/XORNode.java        |  22 +-
 .../java/ui/AttackTreePanelTranslator.java    |  14 +
 src/main/java/ui/GTURTLEModeling.java         |  26 +-
 src/main/java/ui/MainGUI.java                 |   6 +
 .../java/ui/atd/ATDAttackerPopulation.java    |   6 +-
 .../ui/window/JDialogAttackerPopulation.java  |  79 +-
 .../java/ui/atd/AttackTreeAnalysisTest.java   | 120 +++
 .../ui/atd/input/testAttackTreeAnalysis.xml   | 780 ++++++++++++++++++
 14 files changed, 1114 insertions(+), 96 deletions(-)
 create mode 100644 ttool/src/test/java/ui/atd/AttackTreeAnalysisTest.java
 create mode 100644 ttool/src/test/resources/ui/atd/input/testAttackTreeAnalysis.xml

diff --git a/src/main/java/attacktrees/Attack.java b/src/main/java/attacktrees/Attack.java
index c9ef856f98..4b52f290d1 100755
--- a/src/main/java/attacktrees/Attack.java
+++ b/src/main/java/attacktrees/Attack.java
@@ -56,7 +56,7 @@ public class Attack extends AttackElement {
     public final static int EXPERIENCE_AVERAGE = 1;
     public final static int EXPERIENCE_EXPERT = 2;
 
-    public final static String EXPERIENCES [] = {"Beginner", "Average", "Expert"};
+    public final static String EXPERIENCES [] = {"Beginner", "Intermediate", "Expert"};
 
 
     private AttackNode originNode; // If no origin node -> leaf attack
@@ -123,15 +123,15 @@ public class Attack extends AttackElement {
 
     }
 
-    public Point getMinimalCostAndExperience() {
+    public boolean canPerformAttack(int _resource, int _experience) {
 
         // Leaf attack?
         if (originNode == null) {
-            return new Point(attackCost, attackExperience);
+            return (attackCost <= _resource) && (attackExperience <= _experience);
         }
 
         // Intermediate attack. Needs to compute its resulting cost and experience
-        return originNode.getMinimalCostAndExperience();
+        return originNode.canPerformAttack(_resource, _experience);
     }
 
 }
diff --git a/src/main/java/attacktrees/AttackNode.java b/src/main/java/attacktrees/AttackNode.java
index 6ec1037dff..7562dae724 100755
--- a/src/main/java/attacktrees/AttackNode.java
+++ b/src/main/java/attacktrees/AttackNode.java
@@ -154,26 +154,24 @@ public abstract class AttackNode extends AttackElement {
         inputValues = newInputValues;
     }
 
-    public Point getMinimalCostAndExperience() {
+    public boolean canPerformAttack(int _resource, int _experience) {
 
-        TraceManager.addDev("In node: " + this.getClass());
+        //TraceManager.addDev("In node: " + this.getClass());
 
         if ((inputAttacks == null) || (inputAttacks.size() == 0)) {
-            return new Point(0, 0);
+            return true;
         }
 
         // Built from the lower attacks. Assume all attacks are necessary
 
-        int attackCost = 0;
-        int attackExperience = Attack.EXPERIENCE_BEGINNER;
 
         for(Attack attack: inputAttacks) {
-            Point p = attack.getMinimalCostAndExperience();
-            attackCost += p.x;
-            attackExperience = Math.max(attackExperience, p.y);
+            if (!attack.canPerformAttack(_resource, _experience)) {
+                return false;
+            }
         }
 
-        return new Point(attackCost, attackExperience);
+        return true;
     }
 
 }
diff --git a/src/main/java/attacktrees/AttackTree.java b/src/main/java/attacktrees/AttackTree.java
index 6e02d36de7..cc463f27d0 100755
--- a/src/main/java/attacktrees/AttackTree.java
+++ b/src/main/java/attacktrees/AttackTree.java
@@ -60,11 +60,14 @@ public class AttackTree extends AttackElement {
     public AttackElement faultyElement;
     public String errorOfFaultyElement;
 
+    private ArrayList<AttackerPopulation> populations;
+
 
     public AttackTree(String _name, Object _reference) {
         super(_name, _reference);
-        nodes = new ArrayList<AttackNode>();
-        attacks = new ArrayList<Attack>();
+        nodes = new ArrayList<>();
+        attacks = new ArrayList<>();
+        populations = new ArrayList<>();
     }
 
     public void addNode(AttackNode _node) {
@@ -75,6 +78,8 @@ public class AttackTree extends AttackElement {
         attacks.add(_attack);
     }
 
+    public void addPopulation(AttackerPopulation _ap) {populations.add(_ap);}
+
     public String toString() {
         StringBuffer sb = new StringBuffer();
         sb.append("List of nodes:");
@@ -92,6 +97,8 @@ public class AttackTree extends AttackElement {
         return nodes;
     }
 
+    public ArrayList<AttackerPopulation> getAttackerPopulation() { return populations;}
+
     // Checks:
     // Sequence/after/before nodes have attacks which are ordered (i.e. unique positive number)
     // Time value is positive in before and after
@@ -156,32 +163,8 @@ public class AttackTree extends AttackElement {
     }
 
 
-    public HashMap<Attack, Point> getAllMinimalCostAndExperience() {
-        if ((attacks == null) || (attacks.size() == 0)) {
-            TraceManager.addDev("Null attacks");
-            return null;
-        }
-
-        HashMap<Attack, Point> map = new HashMap<>();
-        for(Attack attack: attacks) {
-            if (attack.isRoot()) {
-                Point p = attack.getMinimalCostAndExperience();
-                if (p != null) {
-                    map.put(attack, p);
-                }
-            }
-        }
-
-        return map;
-
-    }
-
-    public Point getMinimalCostAndExperience() {
 
-        if ((attacks == null) || (attacks.size() == 0)) {
-            TraceManager.addDev("Null attacks");
-            return null;
-        }
+    public boolean canPerformRootAttack(int _resource, int _experience) {
 
         // Must find the root attack
         Attack rootAttack = null;
@@ -194,14 +177,33 @@ public class AttackTree extends AttackElement {
 
         if (rootAttack == null) {
             TraceManager.addDev("No root attack");
-            return null;
+            return false;
+        }
+
+        //TraceManager.addDev("Considering root attack:" + rootAttack.getName());
+
+        return rootAttack.canPerformAttack(_resource, _experience);
+    }
+
+    public ArrayList<Double> analyse() {
+        ArrayList<Double> ret = new ArrayList<>(populations.size());
+
+        for (AttackerPopulation ap: populations) {
+            double d = ap.getTotalAttackers(this);
+            ret.add(new Double(d/ap.getTotalPopulation()));
         }
 
-        TraceManager.addDev("Considering root attack:" + rootAttack.getName());
+        return ret;
+    }
 
-        Point p = rootAttack.getMinimalCostAndExperience();
+    public double analyse(String _populationName) {
+        for (AttackerPopulation ap: populations) {
+            if (ap.getName().compareTo(_populationName) == 0) {
+                return ap.getTotalAttackers(this) / ap.getTotalPopulation();
+            }
+        }
+        return -1;
 
-        return p;
     }
 
 
diff --git a/src/main/java/attacktrees/AttackerGroup.java b/src/main/java/attacktrees/AttackerGroup.java
index ac7d15a699..2fa368604d 100644
--- a/src/main/java/attacktrees/AttackerGroup.java
+++ b/src/main/java/attacktrees/AttackerGroup.java
@@ -41,6 +41,7 @@ package attacktrees;
 
 
 import myutil.Conversion;
+import myutil.TraceManager;
 
 /**
  * Class Attacker
@@ -50,6 +51,8 @@ import myutil.Conversion;
  * @version 1.0 04/02/2021
  */
 public class AttackerGroup extends AttackElement {
+    public static String SEP = "; ";
+
     public Attacker attacker;
     public int occurrence;
 
@@ -59,11 +62,11 @@ public class AttackerGroup extends AttackElement {
     }
 
     public String toString() {
-        String ret = name + " Money: " + attacker.money;
+        String ret = name + SEP + " Money: " + attacker.money + SEP;
         if ((attacker.expertise >= 0) && (attacker.expertise < Attack.EXPERIENCES.length)) {
-            ret += " Expertise: " + Attack.EXPERIENCES[attacker.expertise];
+            ret += " Expertise: " + Attack.EXPERIENCES[attacker.expertise] + SEP;
         } else {
-            ret += " Expertise: " + attacker.expertise;
+            ret += " Expertise: " + attacker.expertise + SEP;
         }
 
         ret += " number: " + occurrence;
@@ -82,6 +85,13 @@ public class AttackerGroup extends AttackElement {
         return occurrence;
     }
 
+    public void setAttributes(int _money, int _expertise, int _occurrence) {
+        TraceManager.addDev("Setting money = " + _money);
+        attacker.money = _money;
+        attacker.expertise = _expertise;
+        occurrence = _occurrence;
+    }
+
     public static boolean isValidOccurrence(String _occurence) {
         if ((_occurence == null) || (_occurence.length() == 0)) {
             return false;
diff --git a/src/main/java/attacktrees/AttackerPopulation.java b/src/main/java/attacktrees/AttackerPopulation.java
index 6bd100b78c..93680d1fdd 100644
--- a/src/main/java/attacktrees/AttackerPopulation.java
+++ b/src/main/java/attacktrees/AttackerPopulation.java
@@ -71,8 +71,12 @@ public class AttackerPopulation extends AttackElement {
         groups.add(ag);
     }
 
-    public void addAttackerGroup(AttackerGroup _group) {
-        groups.add(_group);
+
+    public AttackerGroup addCloneAttackerGroup(AttackerGroup _group) {
+        AttackerGroup ag = new AttackerGroup(_group.getName(), _group.getReferenceObject());
+        ag.setAttributes(_group.getMoney(),_group.getExpertise(), _group.getOccurrence());
+        groups.add(ag);
+        return ag;
     }
 
     public AttackerGroup addAttackerGroup(String _name, String _money, String _expertise, String _occurrence) {
@@ -110,17 +114,40 @@ public class AttackerPopulation extends AttackElement {
         return cpt;
     }
 
+
+
+    public int getTotalAttackers(AttackTree _at) {
+        int cpt = 0;
+        for(AttackerGroup ag: groups) {
+            if (_at.canPerformRootAttack(ag.getMoney(), ag.getExpertise())) {
+                cpt += ag.occurrence;
+            }
+        }
+        return cpt;
+    }
+
     public void setGroup(ArrayList<AttackerGroup> _newGroup) {
         groups.clear();
         groups.addAll(_newGroup);
     }
 
 
-
     public ArrayList<AttackerGroup> getAttackerGroups() {
         return groups;
     }
 
+    public String toString() {
+        StringBuffer sb = new StringBuffer();
+        sb.append(getName() + ":\n");
+        for(AttackerGroup ag: groups) {
+            sb.append(ag.toString() + "\n");
+        }
+        return sb.toString();
+    }
+
+
+
+
 
 
 }
diff --git a/src/main/java/attacktrees/ORNode.java b/src/main/java/attacktrees/ORNode.java
index 97e8caff7f..0c28a4c58b 100755
--- a/src/main/java/attacktrees/ORNode.java
+++ b/src/main/java/attacktrees/ORNode.java
@@ -58,25 +58,25 @@ public class ORNode extends BooleanNode {
         type = "OR";
     }
 
-    public Point getMinimalCostAndExperience() {
-        TraceManager.addDev("In node: " + this.getClass());
+    public boolean canPerformAttack(int _resource, int _experience) {
+
+        //TraceManager.addDev("In node: " + this.getClass());
 
         if ((inputAttacks == null) || (inputAttacks.size() == 0)) {
-            return new Point(0, 0);
+            return true;
         }
 
         // Built from the lower attacks. Assume all attacks are necessary
 
-        int attackCost = Integer.MAX_VALUE;
-        int attackExperience = Attack.EXPERIENCE_EXPERT;
-
         for(Attack attack: inputAttacks) {
-            Point p = attack.getMinimalCostAndExperience();
-            attackCost = Math.min(p.x, attackCost);
-            attackExperience = Math.min(attackExperience, p.y);
+            if (attack.canPerformAttack(_resource, _experience)) {
+                return true;
+            }
         }
 
-        return new Point(attackCost, attackExperience);
+        return false;
     }
+
+
     
 }
diff --git a/src/main/java/attacktrees/XORNode.java b/src/main/java/attacktrees/XORNode.java
index 4db1e5693b..db4f39b4da 100755
--- a/src/main/java/attacktrees/XORNode.java
+++ b/src/main/java/attacktrees/XORNode.java
@@ -55,24 +55,22 @@ public class XORNode extends BooleanNode {
         type = "XOR";
     }
 
-    public Point getMinimalCostAndExperience() {
+    
+    public boolean canPerformAttack(int _resource, int _experience) {
+
         if ((inputAttacks == null) || (inputAttacks.size() == 0)) {
-            return new Point(0, 0);
+            return true;
         }
 
         // Built from the lower attacks. Assume all attacks are necessary
-
-        int attackCost = Integer.MAX_VALUE;
-        int attackExperience = Attack.EXPERIENCE_EXPERT;
-
-        for (Attack attack : inputAttacks) {
-            Point p = attack.getMinimalCostAndExperience();
-            attackCost = Math.min(p.x, attackCost);
-            attackExperience = Math.min(attackExperience, p.y);
+        int cpt = 0;
+        for(Attack attack: inputAttacks) {
+            if (attack.canPerformAttack(_resource, _experience)) {
+                cpt ++;
+            }
         }
 
-        return new Point(attackCost, attackExperience);
+        return (cpt == 1);
     }
 
-
 }
diff --git a/src/main/java/ui/AttackTreePanelTranslator.java b/src/main/java/ui/AttackTreePanelTranslator.java
index 5317a0eeb0..9683fa05f2 100644
--- a/src/main/java/ui/AttackTreePanelTranslator.java
+++ b/src/main/java/ui/AttackTreePanelTranslator.java
@@ -41,6 +41,7 @@ package ui;
 
 import attacktrees.*;
 import avatartranslator.*;
+import myutil.TraceManager;
 import translator.CheckingError;
 import ui.atd.*;
 
@@ -134,6 +135,19 @@ public class AttackTreePanelTranslator {
 
         //Create attacks, nodes
         for (TGComponent comp : allComponents) {
+
+            // Population
+            if (comp instanceof ATDAttackerPopulation) {
+                ATDAttackerPopulation atdap = (ATDAttackerPopulation)comp;
+                AttackerPopulation pop = new AttackerPopulation(atdap.getAttackerPopulation().getName(), comp);
+                for(AttackerGroup ag: atdap.getAttackerPopulation().getAttackerGroups()) {
+                    //TraceManager.addDev("Group: " + ag.toString());
+                    pop.addCloneAttackerGroup(ag);
+                }
+                at.addPopulation(pop);
+            }
+
+            // Attacks
             if (comp instanceof ATDAttack) {
                 ATDAttack atdatt = (ATDAttack) comp;
                 Attack att;
diff --git a/src/main/java/ui/GTURTLEModeling.java b/src/main/java/ui/GTURTLEModeling.java
index 470c355043..253b00ba93 100644
--- a/src/main/java/ui/GTURTLEModeling.java
+++ b/src/main/java/ui/GTURTLEModeling.java
@@ -40,6 +40,7 @@ package ui;
 
 import attacktrees.Attack;
 import attacktrees.AttackTree;
+import attacktrees.AttackerPopulation;
 import avatartranslator.*;
 import avatartranslator.toproverif.AVATAR2ProVerif;
 import avatartranslator.totpn.AVATAR2TPN;
@@ -8501,14 +8502,9 @@ public class GTURTLEModeling {
             return false;
         }
 
-        // Compute min cost and experience
-        TraceManager.addDev("Min cost and experience:");
-        AttackTree at = att.getAttackTree();
-        Point p = at.getMinimalCostAndExperience();
-        if (p == null) {
-            TraceManager.addDev("-> Null answer");
-        } else {
-            TraceManager.addDev("-> " + p.getX() + ", " + p.getY() + " [" + Attack.EXPERIENCES[(int)(p.getY())] + "]");
+        TraceManager.addDev("Attacker populations:\n");
+        for(AttackerPopulation ap: att.getAttackTree().getAttackerPopulation()) {
+            TraceManager.addDev("Population:\n" + ap.toString() + "\n");
         }
 
 
@@ -8517,6 +8513,20 @@ public class GTURTLEModeling {
         return true;
     }
 
+    public AttackTree getAttackTree(AttackTreePanel atp, int index) {
+        AttackTreePanelTranslator att = new AttackTreePanelTranslator(atp, index);
+        /*attackTree =*/
+        att.translateToAttackTreeDataStructure();
+        checkingErrors = att.getCheckingErrors();
+        warnings = att.getWarnings();
+        if ((checkingErrors != null) && (checkingErrors.size() > 0)) {
+            return null;
+        }
+        return att.getAttackTree();
+
+
+    }
+
     public boolean translateFaultTreePanel(FaultTreePanel atp) {
         FaultTreePanelTranslator att = new FaultTreePanelTranslator(atp);
         /*attackTree =*/
diff --git a/src/main/java/ui/MainGUI.java b/src/main/java/ui/MainGUI.java
index 3417c67813..bf94899e62 100644
--- a/src/main/java/ui/MainGUI.java
+++ b/src/main/java/ui/MainGUI.java
@@ -39,6 +39,7 @@
 
 package ui;
 
+import attacktrees.AttackTree;
 import avatartranslator.AvatarSpecification;
 import common.ConfigurationTTool;
 import common.SpecConfigTTool;
@@ -4274,6 +4275,11 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per
         return ret;
     }
 
+    public AttackTree runAttackTreeAnalysis() {
+        AttackTreePanel atp = (AttackTreePanel) getCurrentTURTLEPanel();
+        return gtm.getAttackTree(atp, getTDiagramPanelIndex());
+    }
+
     public List<TAttribute> getAllAttributes() {
         TURTLEPanel tp = getCurrentTURTLEPanel();
         String name = getCurrentTDiagramPanel().getName();
diff --git a/src/main/java/ui/atd/ATDAttackerPopulation.java b/src/main/java/ui/atd/ATDAttackerPopulation.java
index 5af7193109..1934672472 100644
--- a/src/main/java/ui/atd/ATDAttackerPopulation.java
+++ b/src/main/java/ui/atd/ATDAttackerPopulation.java
@@ -138,9 +138,9 @@ public class ATDAttackerPopulation extends TGCScalableWithInternalComponent impl
         String tmp;
         boolean error = false;
 
-        JDialogAttackerPopulation dialog = new JDialogAttackerPopulation(frame, "Setting attackers", population);
+        JDialogAttackerPopulation dialog = new JDialogAttackerPopulation(getTDiagramPanel().getMainGUI(), frame, "Setting attackers", population);
         //     dialog.setSize(450, 350);
-        GraphicLib.centerOnParent(dialog, 850, 350);
+        GraphicLib.centerOnParent(dialog, 950, 650);
         dialog.setVisible(true); // blocked until dialog has been closed
 
         return dialog.hasBeenCancelled();
@@ -218,7 +218,7 @@ public class ATDAttackerPopulation extends TGCScalableWithInternalComponent impl
    }
 
    public String getAttributes() {
-        return "";
+        return population.toString();
    }
 
 
diff --git a/src/main/java/ui/window/JDialogAttackerPopulation.java b/src/main/java/ui/window/JDialogAttackerPopulation.java
index eeb3743fad..b125c91fe1 100644
--- a/src/main/java/ui/window/JDialogAttackerPopulation.java
+++ b/src/main/java/ui/window/JDialogAttackerPopulation.java
@@ -39,13 +39,10 @@
 
 package ui.window;
 
-import attacktrees.Attack;
-import attacktrees.Attacker;
-import attacktrees.AttackerGroup;
-import attacktrees.AttackerPopulation;
+import attacktrees.*;
 import myutil.Conversion;
 import myutil.TraceManager;
-import ui.TAttribute;
+import ui.MainGUI;
 
 import javax.swing.*;
 import javax.swing.event.ListSelectionEvent;
@@ -64,12 +61,13 @@ import java.util.ArrayList;
  * @author Ludovic APVRILLE
  * @version 2.0 04/02/2021
  */
-public class JDialogAttackerPopulation extends JDialogBase implements ActionListener, ListSelectionListener {
+public class JDialogAttackerPopulation extends JDialogBase implements ActionListener, ListSelectionListener, Runnable {
     protected AttackerPopulation population;
     protected ArrayList<AttackerGroup> groups;
 
     protected JPanel panel1, panel2;
 
+    protected MainGUI mgui;
     protected Frame frame;
 
     protected String attrib = "Attacker group";
@@ -92,14 +90,17 @@ public class JDialogAttackerPopulation extends JDialogBase implements ActionList
     protected JButton upButton;
     protected JButton downButton;
     protected JButton removeButton;
+    protected JButton analyzeButton;
+    protected JTextArea resultArea;
 
     private boolean hasBeenCancelled = true;
 
 
     /* Creates new form  */
-    public JDialogAttackerPopulation(Frame f,
+    public JDialogAttackerPopulation(MainGUI _mgui, Frame f,
                                      String title, AttackerPopulation _population) {
         super(f, title, true);
+        mgui = _mgui;
         frame = f;
         population = _population;
         name = population.getName();
@@ -268,21 +269,39 @@ public class JDialogAttackerPopulation extends JDialogBase implements ActionList
             c.add(panelName, c0);
         }
 
-
         // main panel;
         c0.gridwidth = 1;
-        c0.gridheight = 10;
+        c0.gridheight = 15;
         c0.weighty = 1.0;
         c0.weightx = 1.0;
         c0.fill = GridBagConstraints.BOTH;
 
-
         c.add(panel1, c0);
         c0.gridwidth = GridBagConstraints.REMAINDER; //end row
         c.add(panel2, c0);
 
-        c0.gridwidth = 1;
+        // Analysis panel
         c0.gridheight = 1;
+        analyzeButton = new JButton("Analyze");
+        analyzeButton.addActionListener(this);
+        c.add(analyzeButton, c0);
+
+        JPanel jta = new JPanel();
+        jta.setBorder(new javax.swing.border.TitledBorder("Results"));
+        Font f = new Font("Courrier", Font.BOLD, 12);
+        jta.setFont(f);
+        resultArea = new JTextArea();
+        JScrollPane jsp = new JScrollPane(resultArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
+        jsp.setPreferredSize(new Dimension(600, 150));
+        jta.add(jsp);
+        resultArea.append("Click on \"Analyse\" to analyse the current population");
+
+        c0.gridheight = 25;
+        c.add(jta, c0);
+
+
+        c0.gridheight = 1;
+        c0.gridwidth = GridBagConstraints.REMAINDER;
         c0.fill = GridBagConstraints.HORIZONTAL;
 
         initButtons(c0, c, this);
@@ -305,6 +324,9 @@ public class JDialogAttackerPopulation extends JDialogBase implements ActionList
             downAttribute();
         } else if (command.equals("Up")) {
             upAttribute();
+        } else if (evt.getSource() == analyzeButton) {
+            Thread t = new Thread(this);
+            t.start();
         }
     }
 
@@ -437,9 +459,9 @@ public class JDialogAttackerPopulation extends JDialogBase implements ActionList
         } else {
             AttackerGroup a = groups.get(i);
             identifierText.setText(a.getName());
-            moneyText.setText(""+a.getMoney());
+            moneyText.setText("" + a.getMoney());
             expertise.setSelectedIndex(a.getExpertise());
-            nbText.setText(""+a.getOccurrence());
+            nbText.setText("" + a.getOccurrence());
             removeButton.setEnabled(true);
             if (i > 0) {
                 upButton.setEnabled(true);
@@ -478,5 +500,36 @@ public class JDialogAttackerPopulation extends JDialogBase implements ActionList
         return hasBeenCancelled;
     }
 
+    // Analysis
+    public void run() {
+        // Must check the syntax of the system
+        resultArea.append("\n\nRunning analysis\n");
+        resultArea.append("\tSyntax checking\n");
+        if (!mgui.checkModelingSyntax(true)) {
+            resultArea.append("\t\t-> KO\n");
+            return;
+        }
+        resultArea.append("\t\t-> OK\n");
+        resultArea.append("\tTree analysis\n");
+        AttackTree at  = mgui.runAttackTreeAnalysis();
+        if (at == null) {
+            resultArea.append("\t\t-> KO\n");
+            return;
+        }
+        resultArea.append("\t\t-> OK\n");
+
+
+
+        AttackerPopulation pop = new AttackerPopulation(population.getName(), population.getReferenceObject());
+        pop.setGroup(groups);
+        int size = pop.getTotalPopulation();
+        int success = pop.getTotalAttackers(at);
+        resultArea.append("\tPopulation analysis\n");
+        resultArea.append("\t\tTotal population: " + size + "\n");
+        resultArea.append("\t\tSuccessful attackers: " + success + "\n");
+        resultArea.append("\t\t% of successful attackers: " + (int)(100.0 * success/size) + "%\n");
+        resultArea.append("\t\tProbability of success: " + ((double)success/size) + "\n");
+    }
+
 
 }
diff --git a/ttool/src/test/java/ui/atd/AttackTreeAnalysisTest.java b/ttool/src/test/java/ui/atd/AttackTreeAnalysisTest.java
new file mode 100644
index 0000000000..f7a76e8279
--- /dev/null
+++ b/ttool/src/test/java/ui/atd/AttackTreeAnalysisTest.java
@@ -0,0 +1,120 @@
+/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille
+ *
+ * ludovic.apvrille AT enst.fr
+ *
+ * This software is a computer program whose purpose is to allow the
+ * edition of TURTLE analysis, design and deployment diagrams, to
+ * allow the generation of RT-LOTOS or Java code from this diagram,
+ * and at last to allow the analysis of formal validation traces
+ * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP
+ * from INRIA Rhone-Alpes.
+ *
+ * This software is governed by the CeCILL  license under French law and
+ * abiding by the rules of distribution of free software.  You can  use,
+ * modify and/ or redistribute the software under the terms of the CeCILL
+ * license as circulated by CEA, CNRS and INRIA at the following URL
+ * "http://www.cecill.info".
+ *
+ * As a counterpart to the access to the source code and  rights to copy,
+ * modify and redistribute granted by the license, users are provided only
+ * with a limited warranty  and the software's author,  the holder of the
+ * economic rights,  and the successive licensors  have only  limited
+ * liability.
+ *
+ * In this respect, the user's attention is drawn to the risks associated
+ * with loading,  using,  modifying and/or developing or reproducing the
+ * software by the user in light of its specific status of free software,
+ * that may mean  that it is complicated to manipulate,  and  that  also
+ * therefore means  that it is reserved for developers  and  experienced
+ * professionals having in-depth computer knowledge. Users are therefore
+ * encouraged to load and test the software's suitability as regards their
+ * requirements in conditions enabling the security of their systems and/or
+ * data to be ensured and,  more generally, to use and operate it in the
+ * same conditions as regards security.
+ *
+ * The fact that you are presently reading this means that you have had
+ * knowledge of the CeCILL license and that you accept its terms.
+ */
+
+
+package ui.atd;
+
+import attacktrees.AttackTree;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import ui.AbstractUITest;
+import ui.AttackTreePanel;
+import ui.TDiagramPanel;
+import ui.TURTLEPanel;
+import ui.tmldd.TMLArchiDiagramPanel;
+
+import java.io.File;
+import java.util.ArrayList;
+
+import static org.junit.Assert.*;
+
+
+/**
+ * Testing the clone function on architecture
+ * author : Ludovic Apvrille
+ * update test : 08/02/2021
+ */
+public class AttackTreeAnalysisTest extends AbstractUITest {
+
+    private static final String PATH_TO_SOURCE_MODEL = "/ui/atd/input/testAttackTreeAnalysis.xml";
+
+    private static final double RESULTS[] = {0.8, 0.6, 0.8};
+
+
+    public AttackTreeAnalysisTest() {
+        super();
+
+        // Open expected model
+        System.out.println("File: " + RESOURCES_DIR);
+        mainGUI.openProjectFromFile(new File(RESOURCES_DIR));
+
+
+    }
+
+    @BeforeClass
+    public static void setUpBeforeClass() throws Exception {
+        RESOURCES_DIR = getBaseResourcesDir() + PATH_TO_SOURCE_MODEL;
+    }
+
+
+
+    @Test
+    public void testAttackTreeAnalysis() {
+        int cpt = 0;
+
+        assertFalse(mainGUI == null);
+        assertFalse(mainGUI.getTabs() == null);
+
+        for (TURTLEPanel _tab : mainGUI.getTabs()) {
+            if (_tab instanceof AttackTreePanel) {
+                for (TDiagramPanel tdp : _tab.getPanels()) {
+                    if (tdp instanceof AttackTreeDiagramPanel) {
+                        mainGUI.selectTab(tdp);
+                        System.out.println("Tab:" + tdp.getName());
+                        analyse(cpt);
+                        cpt ++;
+                    }
+                }
+                break;
+            }
+        }
+    }
+
+    public void analyse(int cpt) {
+        assertTrue(mainGUI.checkModelingSyntax(true));
+        AttackTree at  = mainGUI.runAttackTreeAnalysis();
+        assertFalse(at == null);
+        ArrayList<Double> res = at.analyse();
+        assertTrue(res.size() == 1);
+        Double d0 = res.get(0);
+        System.out.println("d0=" + d0 + " results:" + RESULTS[cpt]);
+        assertTrue(d0.doubleValue() == RESULTS[cpt]);
+    }
+
+}
\ No newline at end of file
diff --git a/ttool/src/test/resources/ui/atd/input/testAttackTreeAnalysis.xml b/ttool/src/test/resources/ui/atd/input/testAttackTreeAnalysis.xml
new file mode 100644
index 0000000000..d96ea36deb
--- /dev/null
+++ b/ttool/src/test/resources/ui/atd/input/testAttackTreeAnalysis.xml
@@ -0,0 +1,780 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<TURTLEGMODELING version="1.0beta" ANIMATE_INTERACTIVE_SIMULATION="true" ACTIVATE_PENALTIES="true" UPDATE_INFORMATION_DIPLO_SIM="true" ANIMATE_WITH_INFO_DIPLO_SIM="true" OPEN_DIAG_DIPLO_SIM="false" LAST_SELECTED_MAIN_TAB="0" LAST_SELECTED_SUB_TAB="0">
+
+<Modeling type="AttackTree" nameTab="AttackTrees_BasicExamples" >
+<AttackTreeDiagramPanel name="AttackTreeOR" minX="10" maxX="2500" minY="10" maxY="1500" zoom="1.0" >
+<CONNECTOR type="133" id="2" >
+<cdparam x="618" y="293" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<infoparam name="connector" value="" />
+<TGConnectingPoint num="0" id="1" />
+<P1  x="603" y="302" id="29" />
+<P2  x="471" y="252" id="27" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR>
+<CONNECTOR type="133" id="4" >
+<cdparam x="440" y="191" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<infoparam name="connector" value="" />
+<TGConnectingPoint num="0" id="3" />
+<P1  x="434" y="202" id="16" />
+<P2  x="434" y="137" id="82" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR>
+<CONNECTOR type="133" id="6" >
+<cdparam x="308" y="293" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<infoparam name="connector" value="" />
+<TGConnectingPoint num="0" id="5" />
+<P1  x="310" y="293" id="59" />
+<P2  x="396" y="252" id="26" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR>
+<COMPONENT type="1402" id="28" >
+<cdparam x="359" y="202" />
+<sizeparam width="150" height="50" minWidth="100" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="TGComponent" value="&lt;&lt;OR&gt;&gt;" />
+<TGConnectingPoint num="0" id="16" />
+<TGConnectingPoint num="1" id="17" />
+<TGConnectingPoint num="2" id="18" />
+<TGConnectingPoint num="3" id="19" />
+<TGConnectingPoint num="4" id="20" />
+<TGConnectingPoint num="5" id="21" />
+<TGConnectingPoint num="6" id="22" />
+<TGConnectingPoint num="7" id="23" />
+<TGConnectingPoint num="8" id="24" />
+<TGConnectingPoint num="9" id="25" />
+<TGConnectingPoint num="10" id="26" />
+<TGConnectingPoint num="11" id="27" />
+<extraparam>
+<info equation="" />
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="1401" id="53" >
+<cdparam x="553" y="302" />
+<sizeparam width="100" height="40" minWidth="100" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="TGComponent" value="attack1" />
+<TGConnectingPoint num="0" id="29" />
+<TGConnectingPoint num="1" id="30" />
+<TGConnectingPoint num="2" id="31" />
+<TGConnectingPoint num="3" id="32" />
+<TGConnectingPoint num="4" id="33" />
+<TGConnectingPoint num="5" id="34" />
+<TGConnectingPoint num="6" id="35" />
+<TGConnectingPoint num="7" id="36" />
+<TGConnectingPoint num="8" id="37" />
+<TGConnectingPoint num="9" id="38" />
+<TGConnectingPoint num="10" id="39" />
+<TGConnectingPoint num="11" id="40" />
+<TGConnectingPoint num="12" id="41" />
+<TGConnectingPoint num="13" id="42" />
+<TGConnectingPoint num="14" id="43" />
+<TGConnectingPoint num="15" id="44" />
+<TGConnectingPoint num="16" id="45" />
+<TGConnectingPoint num="17" id="46" />
+<TGConnectingPoint num="18" id="47" />
+<TGConnectingPoint num="19" id="48" />
+<TGConnectingPoint num="20" id="49" />
+<TGConnectingPoint num="21" id="50" />
+<TGConnectingPoint num="22" id="51" />
+<TGConnectingPoint num="23" id="52" />
+<extraparam>
+<info description="blah blah blah" root="false" cost="10" experience="2" />
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="1401" id="78" >
+<cdparam x="235" y="293" />
+<sizeparam width="100" height="40" minWidth="100" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="TGComponent" value="attack0" />
+<TGConnectingPoint num="0" id="54" />
+<TGConnectingPoint num="1" id="55" />
+<TGConnectingPoint num="2" id="56" />
+<TGConnectingPoint num="3" id="57" />
+<TGConnectingPoint num="4" id="58" />
+<TGConnectingPoint num="5" id="59" />
+<TGConnectingPoint num="6" id="60" />
+<TGConnectingPoint num="7" id="61" />
+<TGConnectingPoint num="8" id="62" />
+<TGConnectingPoint num="9" id="63" />
+<TGConnectingPoint num="10" id="64" />
+<TGConnectingPoint num="11" id="65" />
+<TGConnectingPoint num="12" id="66" />
+<TGConnectingPoint num="13" id="67" />
+<TGConnectingPoint num="14" id="68" />
+<TGConnectingPoint num="15" id="69" />
+<TGConnectingPoint num="16" id="70" />
+<TGConnectingPoint num="17" id="71" />
+<TGConnectingPoint num="18" id="72" />
+<TGConnectingPoint num="19" id="73" />
+<TGConnectingPoint num="20" id="74" />
+<TGConnectingPoint num="21" id="75" />
+<TGConnectingPoint num="22" id="76" />
+<TGConnectingPoint num="23" id="77" />
+<extraparam>
+<info description="blah blah blah" root="false" cost="30" experience="1" />
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="1401" id="103" >
+<cdparam x="373" y="97" />
+<sizeparam width="122" height="40" minWidth="100" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="TGComponent" value="myRootAttackOR" />
+<TGConnectingPoint num="0" id="79" />
+<TGConnectingPoint num="1" id="80" />
+<TGConnectingPoint num="2" id="81" />
+<TGConnectingPoint num="3" id="82" />
+<TGConnectingPoint num="4" id="83" />
+<TGConnectingPoint num="5" id="84" />
+<TGConnectingPoint num="6" id="85" />
+<TGConnectingPoint num="7" id="86" />
+<TGConnectingPoint num="8" id="87" />
+<TGConnectingPoint num="9" id="88" />
+<TGConnectingPoint num="10" id="89" />
+<TGConnectingPoint num="11" id="90" />
+<TGConnectingPoint num="12" id="91" />
+<TGConnectingPoint num="13" id="92" />
+<TGConnectingPoint num="14" id="93" />
+<TGConnectingPoint num="15" id="94" />
+<TGConnectingPoint num="16" id="95" />
+<TGConnectingPoint num="17" id="96" />
+<TGConnectingPoint num="18" id="97" />
+<TGConnectingPoint num="19" id="98" />
+<TGConnectingPoint num="20" id="99" />
+<TGConnectingPoint num="21" id="100" />
+<TGConnectingPoint num="22" id="101" />
+<TGConnectingPoint num="23" id="102" />
+<extraparam>
+<info description="blah blah blah" root="true" cost="0" experience="0" />
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="1404" id="112" >
+<cdparam x="280" y="427" />
+<sizeparam width="365" height="142" minWidth="100" minHeight="50" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="TGComponent" value="null" />
+<TGConnectingPoint num="0" id="104" />
+<TGConnectingPoint num="1" id="105" />
+<TGConnectingPoint num="2" id="106" />
+<TGConnectingPoint num="3" id="107" />
+<TGConnectingPoint num="4" id="108" />
+<TGConnectingPoint num="5" id="109" />
+<TGConnectingPoint num="6" id="110" />
+<TGConnectingPoint num="7" id="111" />
+<extraparam>
+<attackergroup name="M1" money="130" expertise="2" occurrence="1" />
+<attackergroup name="M2" money="180" expertise="1" occurrence="1" />
+<attackergroup name="M3" money="60" expertise="2" occurrence="1" />
+<attackergroup name="M4" money="40" expertise="2" occurrence="1" />
+<attackergroup name="M5" money="70" expertise="0" occurrence="1" />
+</extraparam>
+</COMPONENT>
+
+
+</AttackTreeDiagramPanel>
+
+<AttackTreeDiagramPanel name="AttackTreeAND" minX="10" maxX="2500" minY="10" maxY="1500" zoom="1.0" >
+<CONNECTOR type="133" id="114" >
+<cdparam x="711" y="303" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<infoparam name="connector" value="" />
+<TGConnectingPoint num="0" id="113" />
+<P1  x="713" y="316" id="132" />
+<P2  x="564" y="262" id="130" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR>
+<CONNECTOR type="133" id="116" >
+<cdparam x="533" y="201" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<infoparam name="connector" value="" />
+<TGConnectingPoint num="0" id="115" />
+<P1  x="527" y="212" id="119" />
+<P2  x="527" y="155" id="185" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR>
+<CONNECTOR type="133" id="118" >
+<cdparam x="401" y="303" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<infoparam name="connector" value="" />
+<TGConnectingPoint num="0" id="117" />
+<P1  x="403" y="303" id="162" />
+<P2  x="489" y="262" id="129" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR>
+<COMPONENT type="1402" id="131" >
+<cdparam x="452" y="212" />
+<sizeparam width="150" height="50" minWidth="100" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="TGComponent" value="&lt;&lt;AND&gt;&gt;" />
+<TGConnectingPoint num="0" id="119" />
+<TGConnectingPoint num="1" id="120" />
+<TGConnectingPoint num="2" id="121" />
+<TGConnectingPoint num="3" id="122" />
+<TGConnectingPoint num="4" id="123" />
+<TGConnectingPoint num="5" id="124" />
+<TGConnectingPoint num="6" id="125" />
+<TGConnectingPoint num="7" id="126" />
+<TGConnectingPoint num="8" id="127" />
+<TGConnectingPoint num="9" id="128" />
+<TGConnectingPoint num="10" id="129" />
+<TGConnectingPoint num="11" id="130" />
+<extraparam>
+<info equation="" />
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="1401" id="156" >
+<cdparam x="663" y="316" />
+<sizeparam width="100" height="40" minWidth="100" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="TGComponent" value="attack1" />
+<TGConnectingPoint num="0" id="132" />
+<TGConnectingPoint num="1" id="133" />
+<TGConnectingPoint num="2" id="134" />
+<TGConnectingPoint num="3" id="135" />
+<TGConnectingPoint num="4" id="136" />
+<TGConnectingPoint num="5" id="137" />
+<TGConnectingPoint num="6" id="138" />
+<TGConnectingPoint num="7" id="139" />
+<TGConnectingPoint num="8" id="140" />
+<TGConnectingPoint num="9" id="141" />
+<TGConnectingPoint num="10" id="142" />
+<TGConnectingPoint num="11" id="143" />
+<TGConnectingPoint num="12" id="144" />
+<TGConnectingPoint num="13" id="145" />
+<TGConnectingPoint num="14" id="146" />
+<TGConnectingPoint num="15" id="147" />
+<TGConnectingPoint num="16" id="148" />
+<TGConnectingPoint num="17" id="149" />
+<TGConnectingPoint num="18" id="150" />
+<TGConnectingPoint num="19" id="151" />
+<TGConnectingPoint num="20" id="152" />
+<TGConnectingPoint num="21" id="153" />
+<TGConnectingPoint num="22" id="154" />
+<TGConnectingPoint num="23" id="155" />
+<extraparam>
+<info description="blah blah blah" root="false" cost="10" experience="2" />
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="1401" id="181" >
+<cdparam x="328" y="303" />
+<sizeparam width="100" height="40" minWidth="100" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="TGComponent" value="attack0" />
+<TGConnectingPoint num="0" id="157" />
+<TGConnectingPoint num="1" id="158" />
+<TGConnectingPoint num="2" id="159" />
+<TGConnectingPoint num="3" id="160" />
+<TGConnectingPoint num="4" id="161" />
+<TGConnectingPoint num="5" id="162" />
+<TGConnectingPoint num="6" id="163" />
+<TGConnectingPoint num="7" id="164" />
+<TGConnectingPoint num="8" id="165" />
+<TGConnectingPoint num="9" id="166" />
+<TGConnectingPoint num="10" id="167" />
+<TGConnectingPoint num="11" id="168" />
+<TGConnectingPoint num="12" id="169" />
+<TGConnectingPoint num="13" id="170" />
+<TGConnectingPoint num="14" id="171" />
+<TGConnectingPoint num="15" id="172" />
+<TGConnectingPoint num="16" id="173" />
+<TGConnectingPoint num="17" id="174" />
+<TGConnectingPoint num="18" id="175" />
+<TGConnectingPoint num="19" id="176" />
+<TGConnectingPoint num="20" id="177" />
+<TGConnectingPoint num="21" id="178" />
+<TGConnectingPoint num="22" id="179" />
+<TGConnectingPoint num="23" id="180" />
+<extraparam>
+<info description="blah blah blah" root="false" cost="30" experience="1" />
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="1401" id="206" >
+<cdparam x="465" y="115" />
+<sizeparam width="125" height="40" minWidth="100" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="TGComponent" value="myRootAttackAND" />
+<TGConnectingPoint num="0" id="182" />
+<TGConnectingPoint num="1" id="183" />
+<TGConnectingPoint num="2" id="184" />
+<TGConnectingPoint num="3" id="185" />
+<TGConnectingPoint num="4" id="186" />
+<TGConnectingPoint num="5" id="187" />
+<TGConnectingPoint num="6" id="188" />
+<TGConnectingPoint num="7" id="189" />
+<TGConnectingPoint num="8" id="190" />
+<TGConnectingPoint num="9" id="191" />
+<TGConnectingPoint num="10" id="192" />
+<TGConnectingPoint num="11" id="193" />
+<TGConnectingPoint num="12" id="194" />
+<TGConnectingPoint num="13" id="195" />
+<TGConnectingPoint num="14" id="196" />
+<TGConnectingPoint num="15" id="197" />
+<TGConnectingPoint num="16" id="198" />
+<TGConnectingPoint num="17" id="199" />
+<TGConnectingPoint num="18" id="200" />
+<TGConnectingPoint num="19" id="201" />
+<TGConnectingPoint num="20" id="202" />
+<TGConnectingPoint num="21" id="203" />
+<TGConnectingPoint num="22" id="204" />
+<TGConnectingPoint num="23" id="205" />
+<extraparam>
+<info description="blah blah blah" root="true" cost="0" experience="0" />
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="1404" id="215" >
+<cdparam x="112" y="408" />
+<sizeparam width="365" height="142" minWidth="100" minHeight="50" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="TGComponent" value="null" />
+<TGConnectingPoint num="0" id="207" />
+<TGConnectingPoint num="1" id="208" />
+<TGConnectingPoint num="2" id="209" />
+<TGConnectingPoint num="3" id="210" />
+<TGConnectingPoint num="4" id="211" />
+<TGConnectingPoint num="5" id="212" />
+<TGConnectingPoint num="6" id="213" />
+<TGConnectingPoint num="7" id="214" />
+<extraparam>
+<attackergroup name="M1" money="130" expertise="2" occurrence="1" />
+<attackergroup name="M2" money="180" expertise="1" occurrence="1" />
+<attackergroup name="M3" money="60" expertise="2" occurrence="1" />
+<attackergroup name="M4" money="40" expertise="2" occurrence="1" />
+<attackergroup name="M5" money="70" expertise="0" occurrence="1" />
+</extraparam>
+</COMPONENT>
+
+
+</AttackTreeDiagramPanel>
+
+</Modeling>
+
+
+
+
+<Modeling type="AttackTree" nameTab="AttackTree_GetConfidentialData" >
+<AttackTreeDiagramPanel name="AttackTreeAND" minX="10" maxX="2500" minY="10" maxY="1500" zoom="1.0" >
+<CONNECTOR type="133" id="217" >
+<cdparam x="557" y="169" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<infoparam name="connector" value="" />
+<TGConnectingPoint num="0" id="216" />
+<P1  x="557" y="169" id="326" />
+<P2  x="557" y="99" id="342" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR>
+<CONNECTOR type="133" id="219" >
+<cdparam x="708" y="502" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<infoparam name="connector" value="" />
+<TGConnectingPoint num="0" id="218" />
+<P1  x="708" y="502" id="373" />
+<P2  x="594" y="219" id="337" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR>
+<CONNECTOR type="133" id="221" >
+<cdparam x="487" y="302" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<infoparam name="connector" value="" />
+<TGConnectingPoint num="0" id="220" />
+<P1  x="451" y="300" id="423" />
+<P2  x="519" y="219" id="336" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR>
+<CONNECTOR type="133" id="223" >
+<cdparam x="313" y="457" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<infoparam name="connector" value="" />
+<TGConnectingPoint num="0" id="222" />
+<P1  x="307" y="448" id="226" />
+<P2  x="413" y="350" id="433" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR>
+<CONNECTOR type="133" id="225" >
+<cdparam x="749" y="257" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<infoparam name="connector" value="" />
+<TGConnectingPoint num="0" id="224" />
+<P1  x="822" y="291" id="280" />
+<P2  x="632" y="194" id="328" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR>
+<COMPONENT type="1400" id="275" >
+<cdparam x="192" y="386" />
+<sizeparam width="250" height="200" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Block2" value="Bus" />
+<TGConnectingPoint num="0" id="251" />
+<TGConnectingPoint num="1" id="252" />
+<TGConnectingPoint num="2" id="253" />
+<TGConnectingPoint num="3" id="254" />
+<TGConnectingPoint num="4" id="255" />
+<TGConnectingPoint num="5" id="256" />
+<TGConnectingPoint num="6" id="257" />
+<TGConnectingPoint num="7" id="258" />
+<TGConnectingPoint num="8" id="259" />
+<TGConnectingPoint num="9" id="260" />
+<TGConnectingPoint num="10" id="261" />
+<TGConnectingPoint num="11" id="262" />
+<TGConnectingPoint num="12" id="263" />
+<TGConnectingPoint num="13" id="264" />
+<TGConnectingPoint num="14" id="265" />
+<TGConnectingPoint num="15" id="266" />
+<TGConnectingPoint num="16" id="267" />
+<TGConnectingPoint num="17" id="268" />
+<TGConnectingPoint num="18" id="269" />
+<TGConnectingPoint num="19" id="270" />
+<TGConnectingPoint num="20" id="271" />
+<TGConnectingPoint num="21" id="272" />
+<TGConnectingPoint num="22" id="273" />
+<TGConnectingPoint num="23" id="274" />
+</COMPONENT>
+<SUBCOMPONENT type="1401" id="250" >
+<father id="275" num="0" />
+<cdparam x="257" y="448" />
+<sizeparam width="100" height="40" minWidth="100" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="0" maxX="150" minY="0" maxY="160" />
+<infoparam name="TGComponent" value="BusProbing" />
+<TGConnectingPoint num="0" id="226" />
+<TGConnectingPoint num="1" id="227" />
+<TGConnectingPoint num="2" id="228" />
+<TGConnectingPoint num="3" id="229" />
+<TGConnectingPoint num="4" id="230" />
+<TGConnectingPoint num="5" id="231" />
+<TGConnectingPoint num="6" id="232" />
+<TGConnectingPoint num="7" id="233" />
+<TGConnectingPoint num="8" id="234" />
+<TGConnectingPoint num="9" id="235" />
+<TGConnectingPoint num="10" id="236" />
+<TGConnectingPoint num="11" id="237" />
+<TGConnectingPoint num="12" id="238" />
+<TGConnectingPoint num="13" id="239" />
+<TGConnectingPoint num="14" id="240" />
+<TGConnectingPoint num="15" id="241" />
+<TGConnectingPoint num="16" id="242" />
+<TGConnectingPoint num="17" id="243" />
+<TGConnectingPoint num="18" id="244" />
+<TGConnectingPoint num="19" id="245" />
+<TGConnectingPoint num="20" id="246" />
+<TGConnectingPoint num="21" id="247" />
+<TGConnectingPoint num="22" id="248" />
+<TGConnectingPoint num="23" id="249" />
+<extraparam>
+<info description="blah blah blah" root="false" cost="40" experience="1" />
+</extraparam>
+</SUBCOMPONENT>
+
+<COMPONENT type="1400" id="325" >
+<cdparam x="723" y="210" />
+<sizeparam width="250" height="200" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Block0" value="OS" />
+<TGConnectingPoint num="0" id="301" />
+<TGConnectingPoint num="1" id="302" />
+<TGConnectingPoint num="2" id="303" />
+<TGConnectingPoint num="3" id="304" />
+<TGConnectingPoint num="4" id="305" />
+<TGConnectingPoint num="5" id="306" />
+<TGConnectingPoint num="6" id="307" />
+<TGConnectingPoint num="7" id="308" />
+<TGConnectingPoint num="8" id="309" />
+<TGConnectingPoint num="9" id="310" />
+<TGConnectingPoint num="10" id="311" />
+<TGConnectingPoint num="11" id="312" />
+<TGConnectingPoint num="12" id="313" />
+<TGConnectingPoint num="13" id="314" />
+<TGConnectingPoint num="14" id="315" />
+<TGConnectingPoint num="15" id="316" />
+<TGConnectingPoint num="16" id="317" />
+<TGConnectingPoint num="17" id="318" />
+<TGConnectingPoint num="18" id="319" />
+<TGConnectingPoint num="19" id="320" />
+<TGConnectingPoint num="20" id="321" />
+<TGConnectingPoint num="21" id="322" />
+<TGConnectingPoint num="22" id="323" />
+<TGConnectingPoint num="23" id="324" />
+</COMPONENT>
+<SUBCOMPONENT type="1401" id="300" >
+<father id="325" num="0" />
+<cdparam x="796" y="291" />
+<sizeparam width="104" height="40" minWidth="100" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="0" maxX="146" minY="0" maxY="160" />
+<infoparam name="TGComponent" value="BufferOverflow" />
+<TGConnectingPoint num="0" id="276" />
+<TGConnectingPoint num="1" id="277" />
+<TGConnectingPoint num="2" id="278" />
+<TGConnectingPoint num="3" id="279" />
+<TGConnectingPoint num="4" id="280" />
+<TGConnectingPoint num="5" id="281" />
+<TGConnectingPoint num="6" id="282" />
+<TGConnectingPoint num="7" id="283" />
+<TGConnectingPoint num="8" id="284" />
+<TGConnectingPoint num="9" id="285" />
+<TGConnectingPoint num="10" id="286" />
+<TGConnectingPoint num="11" id="287" />
+<TGConnectingPoint num="12" id="288" />
+<TGConnectingPoint num="13" id="289" />
+<TGConnectingPoint num="14" id="290" />
+<TGConnectingPoint num="15" id="291" />
+<TGConnectingPoint num="16" id="292" />
+<TGConnectingPoint num="17" id="293" />
+<TGConnectingPoint num="18" id="294" />
+<TGConnectingPoint num="19" id="295" />
+<TGConnectingPoint num="20" id="296" />
+<TGConnectingPoint num="21" id="297" />
+<TGConnectingPoint num="22" id="298" />
+<TGConnectingPoint num="23" id="299" />
+<extraparam>
+<info description="blah blah blah" root="false" cost="90" experience="0" />
+</extraparam>
+</SUBCOMPONENT>
+
+<COMPONENT type="1402" id="338" >
+<cdparam x="482" y="169" />
+<sizeparam width="150" height="50" minWidth="100" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="TGComponent" value="&lt;&lt;OR&gt;&gt;" />
+<TGConnectingPoint num="0" id="326" />
+<TGConnectingPoint num="1" id="327" />
+<TGConnectingPoint num="2" id="328" />
+<TGConnectingPoint num="3" id="329" />
+<TGConnectingPoint num="4" id="330" />
+<TGConnectingPoint num="5" id="331" />
+<TGConnectingPoint num="6" id="332" />
+<TGConnectingPoint num="7" id="333" />
+<TGConnectingPoint num="8" id="334" />
+<TGConnectingPoint num="9" id="335" />
+<TGConnectingPoint num="10" id="336" />
+<TGConnectingPoint num="11" id="337" />
+<extraparam>
+<info equation="" />
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="1401" id="363" >
+<cdparam x="490" y="59" />
+<sizeparam width="135" height="40" minWidth="100" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="TGComponent" value="GetConfidentialData" />
+<TGConnectingPoint num="0" id="339" />
+<TGConnectingPoint num="1" id="340" />
+<TGConnectingPoint num="2" id="341" />
+<TGConnectingPoint num="3" id="342" />
+<TGConnectingPoint num="4" id="343" />
+<TGConnectingPoint num="5" id="344" />
+<TGConnectingPoint num="6" id="345" />
+<TGConnectingPoint num="7" id="346" />
+<TGConnectingPoint num="8" id="347" />
+<TGConnectingPoint num="9" id="348" />
+<TGConnectingPoint num="10" id="349" />
+<TGConnectingPoint num="11" id="350" />
+<TGConnectingPoint num="12" id="351" />
+<TGConnectingPoint num="13" id="352" />
+<TGConnectingPoint num="14" id="353" />
+<TGConnectingPoint num="15" id="354" />
+<TGConnectingPoint num="16" id="355" />
+<TGConnectingPoint num="17" id="356" />
+<TGConnectingPoint num="18" id="357" />
+<TGConnectingPoint num="19" id="358" />
+<TGConnectingPoint num="20" id="359" />
+<TGConnectingPoint num="21" id="360" />
+<TGConnectingPoint num="22" id="361" />
+<TGConnectingPoint num="23" id="362" />
+<extraparam>
+<info description="blah blah blah" root="true" cost="0" experience="0" />
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="1404" id="372" >
+<cdparam x="10" y="51" />
+<sizeparam width="365" height="142" minWidth="100" minHeight="50" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="TGComponent" value="null" />
+<TGConnectingPoint num="0" id="364" />
+<TGConnectingPoint num="1" id="365" />
+<TGConnectingPoint num="2" id="366" />
+<TGConnectingPoint num="3" id="367" />
+<TGConnectingPoint num="4" id="368" />
+<TGConnectingPoint num="5" id="369" />
+<TGConnectingPoint num="6" id="370" />
+<TGConnectingPoint num="7" id="371" />
+<extraparam>
+<attackergroup name="M1" money="130" expertise="2" occurrence="1" />
+<attackergroup name="M2" money="180" expertise="1" occurrence="1" />
+<attackergroup name="M3" money="60" expertise="2" occurrence="1" />
+<attackergroup name="M4" money="40" expertise="2" occurrence="1" />
+<attackergroup name="M5" money="70" expertise="0" occurrence="1" />
+</extraparam>
+</COMPONENT>
+
+<COMPONENT type="1400" id="422" >
+<cdparam x="483" y="446" />
+<sizeparam width="412" height="144" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Block3" value="Processor" />
+<TGConnectingPoint num="0" id="398" />
+<TGConnectingPoint num="1" id="399" />
+<TGConnectingPoint num="2" id="400" />
+<TGConnectingPoint num="3" id="401" />
+<TGConnectingPoint num="4" id="402" />
+<TGConnectingPoint num="5" id="403" />
+<TGConnectingPoint num="6" id="404" />
+<TGConnectingPoint num="7" id="405" />
+<TGConnectingPoint num="8" id="406" />
+<TGConnectingPoint num="9" id="407" />
+<TGConnectingPoint num="10" id="408" />
+<TGConnectingPoint num="11" id="409" />
+<TGConnectingPoint num="12" id="410" />
+<TGConnectingPoint num="13" id="411" />
+<TGConnectingPoint num="14" id="412" />
+<TGConnectingPoint num="15" id="413" />
+<TGConnectingPoint num="16" id="414" />
+<TGConnectingPoint num="17" id="415" />
+<TGConnectingPoint num="18" id="416" />
+<TGConnectingPoint num="19" id="417" />
+<TGConnectingPoint num="20" id="418" />
+<TGConnectingPoint num="21" id="419" />
+<TGConnectingPoint num="22" id="420" />
+<TGConnectingPoint num="23" id="421" />
+</COMPONENT>
+<SUBCOMPONENT type="1401" id="397" >
+<father id="422" num="0" />
+<cdparam x="658" y="502" />
+<sizeparam width="100" height="40" minWidth="100" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<enabled value="true" />
+<cdrectangleparam minX="0" maxX="312" minY="0" maxY="104" />
+<infoparam name="TGComponent" value="SCA" />
+<TGConnectingPoint num="0" id="373" />
+<TGConnectingPoint num="1" id="374" />
+<TGConnectingPoint num="2" id="375" />
+<TGConnectingPoint num="3" id="376" />
+<TGConnectingPoint num="4" id="377" />
+<TGConnectingPoint num="5" id="378" />
+<TGConnectingPoint num="6" id="379" />
+<TGConnectingPoint num="7" id="380" />
+<TGConnectingPoint num="8" id="381" />
+<TGConnectingPoint num="9" id="382" />
+<TGConnectingPoint num="10" id="383" />
+<TGConnectingPoint num="11" id="384" />
+<TGConnectingPoint num="12" id="385" />
+<TGConnectingPoint num="13" id="386" />
+<TGConnectingPoint num="14" id="387" />
+<TGConnectingPoint num="15" id="388" />
+<TGConnectingPoint num="16" id="389" />
+<TGConnectingPoint num="17" id="390" />
+<TGConnectingPoint num="18" id="391" />
+<TGConnectingPoint num="19" id="392" />
+<TGConnectingPoint num="20" id="393" />
+<TGConnectingPoint num="21" id="394" />
+<TGConnectingPoint num="22" id="395" />
+<TGConnectingPoint num="23" id="396" />
+<extraparam>
+<info description="" root="false" cost="50" experience="1" />
+</extraparam>
+</SUBCOMPONENT>
+
+<COMPONENT type="1400" id="460" >
+<cdparam x="109" y="10" />
+<sizeparam width="884" height="641" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" />
+<infoparam name="Block1" value="System" />
+<TGConnectingPoint num="0" id="436" />
+<TGConnectingPoint num="1" id="437" />
+<TGConnectingPoint num="2" id="438" />
+<TGConnectingPoint num="3" id="439" />
+<TGConnectingPoint num="4" id="440" />
+<TGConnectingPoint num="5" id="441" />
+<TGConnectingPoint num="6" id="442" />
+<TGConnectingPoint num="7" id="443" />
+<TGConnectingPoint num="8" id="444" />
+<TGConnectingPoint num="9" id="445" />
+<TGConnectingPoint num="10" id="446" />
+<TGConnectingPoint num="11" id="447" />
+<TGConnectingPoint num="12" id="448" />
+<TGConnectingPoint num="13" id="449" />
+<TGConnectingPoint num="14" id="450" />
+<TGConnectingPoint num="15" id="451" />
+<TGConnectingPoint num="16" id="452" />
+<TGConnectingPoint num="17" id="453" />
+<TGConnectingPoint num="18" id="454" />
+<TGConnectingPoint num="19" id="455" />
+<TGConnectingPoint num="20" id="456" />
+<TGConnectingPoint num="21" id="457" />
+<TGConnectingPoint num="22" id="458" />
+<TGConnectingPoint num="23" id="459" />
+</COMPONENT>
+<SUBCOMPONENT type="1402" id="435" >
+<father id="460" num="0" />
+<cdparam x="376" y="300" />
+<sizeparam width="150" height="50" minWidth="100" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<hidden value="false" />
+<cdrectangleparam minX="0" maxX="747" minY="0" maxY="732" />
+<infoparam name="TGComponent" value="&lt;&lt;AND&gt;&gt;" />
+<TGConnectingPoint num="0" id="423" />
+<TGConnectingPoint num="1" id="424" />
+<TGConnectingPoint num="2" id="425" />
+<TGConnectingPoint num="3" id="426" />
+<TGConnectingPoint num="4" id="427" />
+<TGConnectingPoint num="5" id="428" />
+<TGConnectingPoint num="6" id="429" />
+<TGConnectingPoint num="7" id="430" />
+<TGConnectingPoint num="8" id="431" />
+<TGConnectingPoint num="9" id="432" />
+<TGConnectingPoint num="10" id="433" />
+<TGConnectingPoint num="11" id="434" />
+<extraparam>
+<info equation="" />
+</extraparam>
+</SUBCOMPONENT>
+
+
+</AttackTreeDiagramPanel>
+
+</Modeling>
+
+
+
+
+</TURTLEGMODELING>
\ No newline at end of file
-- 
GitLab