Sei sulla pagina 1di 94

Alcatel-Lucent

NPO Diagnosis Development Guide

NPO Document User Guide Release B10, M2, UA5, UA6

3BK 21314 AAAA PCZZA Ed.10

BLANK PAGE BREAK

Status Short title

RELEASED User Guide


All rights reserved. Passing on and copying of this document, use and communication of its contents not permitted without written authorization from Alcatel-Lucent.

2 / 94

3BK 21314 AAAA PCZZA Ed.10

Contents

Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Basic Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1 Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 Diagnosis Module Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Start Diagnosis Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1 Eclipse Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1.1 Title Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1.2 Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1.3 Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Start Diagnosis Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3 Display Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4 Close Diagnosis Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.5 Diagnosis Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.5.1 Scenario Tree View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.5.2 Node Outline View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.5.3 Property View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.5.4 Problem View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.5.5 Scenario Graphical Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.5.6 Node Code Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.5.7 Menubar, Toolbar and Popup Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.5.8 Customizing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1 The Scenario Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 Create Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3 Create Scenario by Copy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4 Edit Scenario/Scenario Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5 Save Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6 Validate/Check Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.7 Delete Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.8 Create Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.8.1 First Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.8.2 Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.8.3 External Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.9 Edit Node Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.10 Edit Node Links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.10.1 Link . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.10.2 Link with Iteration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.10.3 Move a Link . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.11 Edit Link Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.12 Copy Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.13 Delete Node/Link . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Edit Node Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1 Open Node Code Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2 Node Code Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3 Import Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.4 Define Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.4.1 QoS Indicator and Parameter Primitives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.4.2 Topology Navigation Primitives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.4.3 Generic Library Related Primitives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.4.4 List Manipulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5 Test Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.6 Debug Traces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 9 10 10 13 14 15 15 15 15 17 17 18 18 19 20 22 25 30 31 35 37 38 39 43 44 45 46 47 47 47 48 49 50 50 50 51 52 52 53 54 55 56 56 57 57 58 60 62 65 66 68

3BK 21314 AAAA PCZZA Ed.10

3 / 94

Contents

Example Scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1 V2_DR (GSM Technology) Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.1 Problem of unsuccessful Directed Retry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.2 Bad settings of Directed Retry parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.3 Congestion on Potential Target Cell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.4 Failures on Potential Target Cell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.5 Problem of external Directed Retry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.6 Problem of incorrect A_PBGT_DR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.7 Problem of incorrect FREE_LEVEL_DR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.8 Problem of incorrect L_RXLEV_NCELL_DR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.9 Problem of internal Directed Retry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.10 V4_TCONG.Bad settings of queuing parameters . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2 Scenario V2_SDROP(GSM Technology) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.1 SDCCH drop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.2 BSS internal problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.3 Link failure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.4 Processor restart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.5 SDCCH drop HO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.6 SDCCH drop radio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.7 SDCCH drop system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.8 SDCCH HO not activated . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.9 Standalone SDCCH HO problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.10 TCH HO problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.11 TCH radio problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3 WAC Cluster Configuration (WiMAX Technology) Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.1 1st Node Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.2 2nd test Node Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.3 3rd Node Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Introduction to Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.1 Getting Start with Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.1.1 Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.1.2 Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.1.3 Unicode Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.1.4 Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2 Knowing More About Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2.1 First Steps Towards Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2.2 if Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2.3 for Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2.4 The range() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2.5 break and continue Statements and else Clauses on Loop . . . . . . . . . . . . . 6.2.6 pass Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2.7 More About Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

69 70 71 71 72 72 72 73 73 73 74 74 75 76 76 76 76 76 77 77 77 78 78 78 79 80 81 82 83 84 84 86 88 90 91 91 92 92 93 93 94 94

4 / 94

3BK 21314 AAAA PCZZA Ed.10

Figures

Figures
Figure 1: Diagnosis Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Figure 2: Title Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Figure 3: Diagnosis Editor Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Figure 4: Diagnosis Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Figure 5: Node Outline View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Figure 6: Node Outline View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Figure 7: Property Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Figure 8: Node Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Figure 9: Link Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Figure 10: Link with Iteration Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Figure 11: Scenario Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Figure 12: Problem View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Figure 13: Property View Customizing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Figure 14: Error Sorting Criteria . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Figure 15: Error Grouping Criteria . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Figure 16: Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Figure 17: Set Item Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Figure 18: Scenario Graphical Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Figure 19: Node tooltip example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Figure 20: Links and links with iteration in Scenario Graphical Editor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Figure 21: Fly-out Palette . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Figure 22: Fly-out Palette Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Figure 23: Editing Node Code in Scenario graphical Editor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Figure 24: Scenario Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Figure 25: Node Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Figure 26: Help Menu Item . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Figure 27: Context Menu on Scenario Tree Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Figure 28: Context Menu in Scenario Graphical Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Figure 29: Node Context Menu in Graphical Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Figure 30: Context Menu on Property View - Key and Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Figure 31: Context Menu on Property View - Value and Key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Figure 32: Context Menu on Indicator Association in Scenario Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Figure 33: Context Menu on View Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Figure 34: Context Menu on Editor Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Figure 35: Create Scenario Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 Figure 36: Awaiting server response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 Figure 37: Dispatching Request to Get Scenario Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 Figure 38: Edit Scenario Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Figure 39: Node Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

3BK 21314 AAAA PCZZA Ed.10

5 / 94

Figures

Figure 40: Link Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 Figure 41: Link with Iteration Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 Figure 42: Link Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 Figure 43: Link Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 Figure 44: V2_DR Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 Figure 45: Scenario V2_DR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

6 / 94

3BK 21314 AAAA PCZZA Ed.10

Preface

Preface
Purpose Whats New
This document describes the diagnostic solutions provided by the NPO and the Diagnosis Editor.

In Edition 10
Update the sections with information about the W-CDMA.

In Edition 09
The document administrative part is updated.

In Edition 08
Test Syntax (Section 4.5) was updated.

In Edition 07
Overall document quality was improved following an editorial review.

In Edition 06
A note was added in Edit Node Code (Section 4).

In Edition 05
The document was updated after technical validation. WiMAX information was added.

In Edition 04
Overall document quality was improved following an editorial review.

In Edition 03
Validate/Check Scenario (Section 3.6) was updated.

In Edition 02
Graphics were updated.

In Edition 01

3BK 21314 AAAA PCZZA Ed.10

7 / 94

Preface

First official release of the document.

Audience Assumed Knowledge

This guide is intended for operators responsible for diagnosing QoS problems. You must be familiar with the radio network and Network Performance Optimizer (NPO) concepts.

8 / 94

3BK 21314 AAAA PCZZA Ed.10

1 Basic Concepts

1 Basic Concepts
This section provides an overview of the NPO Diagnosis architecture.

3BK 21314 AAAA PCZZA Ed.10

9 / 94

1 Basic Concepts

1.1 Terminology
Diagnosis Scenario A diagnosis scenario is an analysis tree that contains ways to investigate a quality of service problem using the data available in the NPO. The scenario can be system or user defined. Nodes provide code that implements checks in order to evaluate the possible cause of a problem. Links provide the association between nodes. A link is oriented from a consequence node to a causal node. Eclipse is the Diagnosis Development Tool, used to define diagnosis scenarios. The Node Code Editor is used to write the node code.

Node

Link

Eclipse Node Code Editor

1.2 Diagnosis Module Process


The diagnosis functions in Optimization are used to find the probable root cause of a QoS or performance problem. The operator can launch the diagnosis in different contexts: For a detected QoS degradation (typically when a QoS indicator has crossed a threshold) For a network object (e.g. a cell) for which the operator wants to check (and to know what is the problem, if any) For a set of network objects (typically a group of cells) that the operator wants to check. Once executed, the diagnosis returns the results to the operator (who then tunes radio parameters to correct the degradations and optimize the network). Use of the Diagnosis functions is restricted to the owner of the MUSE_ DIAGNOSIS_LICENSE for all use cases. The Diagnosis module includes the following logical blocks: The Diagnosis Development Tool which allows experts to create the diagnosis scenarios. A scenario language is defined to allow the description of scenarios The Advanced Graphical User Interface mechanism (graphical tool, assisted language): Diagnosis user interface to launch the diagnosis and get the results Diagnosis server engine to execute the diagnosis scenarios and provide reports. The diagnosis scenario are defined and configured in the diagnosis tool by an expert (Alcatel-Lucent or operator). The Expert Role can be handled by the system administrator. The Expert uses a dedicated tool in order to develop the diagnosis scenarios. The Administrator imports/exports diagnosis scenarios in the system through the Web administration interface.

10 / 94

3BK 21314 AAAA PCZZA Ed.10

1 Basic Concepts

The operator optimizer is in charge of optimizing the radio network and launches the diagnosis scenario to discover the cause of the problem. The operator should only use the Analysis desktop. It is also possible to define Tuning Session applications in the Diagnosis Editor. These applications trigger the execution of specific checks for tuning parameter validation. Use the System Scheduler to schedule the diagnosis execution.

3BK 21314 AAAA PCZZA Ed.10

11 / 94

1 Basic Concepts

12 / 94

3BK 21314 AAAA PCZZA Ed.10

2 Start Diagnosis Editor

2 Start Diagnosis Editor


This section presents an overview of the Diagnosis Editor.

3BK 21314 AAAA PCZZA Ed.10

13 / 94

2 Start Diagnosis Editor

2.1 Eclipse Environment


Eclipse is an open source community whose projects are focused on providing an extensible development platform and application frameworks for building software. It has a generic set of development services that can be used by any plug-in tool and includes a built-in Java Development Tool plug-in. Eclipse provides the diagnosis expert with a graphical development environment for diagnosis design and scenario creation. The user draws a diagnosis causal tree and then writes each node code, all of them in a user-friendly environment. The Eclipse Platform User Interface is built around a concept of a window that provides the overall structure and presents an extensible user interface to the user. The following complete window is known as the "Diagnosis Editor" (see the following figure).

Figure 1: Diagnosis Editor The Diagnosis Editor is based on editors, views and perspectives.

14 / 94

3BK 21314 AAAA PCZZA Ed.10

2 Start Diagnosis Editor

2.1.1 Title Bar


The title bar is the strip at the at the top of the "Diagnosis Editor" window. It begins with an icon and is followed by the application name, the user name, server IP address and the name of the currently opened scenario. All these are configurable and mandatory. On the right, several icons allow you to minimize, maximize or close the application.

Figure 2: Title Bar

2.1.2 Editors
Editors allow the user to open, edit, and save objects. They follow an open-save-close lifecycle much like file system based tools, but are more tightly integrated into the window. When active, an editor can contribute actions to the "Diagnosis Editor" window menus and tool bar. Two editors appear in tabs in the middle of the window: Scenario Graphical Editor Node Code Editor.

2.1.3 Views
Views provide information about some object that the user is working with in the "Diagnosis Editor" window. Modifications made in a view (such as changing a property value) are generally saved immediately, and the changes are reflected immediately in other related parts of the user interface. There are four views in the "Diagnosis Editor" window: Scenarios View Node Outline View Properties View Problems View. The "Properties View" and "Problems View", corresponding to Scenario Graphical Editor and Node Code Editor are also displayed in tabs. The user can rearrange a view or an editor by drag and drop and customize to better suit a particular task (resizing is possible moving to the left, to the right, to bottom or to top the splitters that separate views and editors).

2.2 Start Diagnosis Editor


To start the Eclipse application: 1. From the icon box, select MUSE Applications->Optimization->Diagnosis Editor. OR From the Analysis Desktop, select Data->Diagnosis.... A splash screen appears to the user with a progress bar displaying the progress in bringing up the Diagnosis Editor.

3BK 21314 AAAA PCZZA Ed.10

15 / 94

2 Start Diagnosis Editor

2. Check that the "Diagnosis Editor" window appears to the user, with all parts displayed at their default location, as shown in the following figure.

Figure 3: Diagnosis Editor Window The Title bar of the "Diagnosis Editor" window displays: The Alcatel-Lucent Diagnosis Editor The user name The server IP address or server hostname. The title bar is updated once a scenario is opened with the name of scenario. Below the Title bar, the customized menus appear: Scenario Menu item, with all the options related to a scenario Nodes Menu item, with all options related to a node. Help menu item

Note:

Each item in the menu is Enabled/Disabled according to the FAD available to the current user. Below the customized menus, there are the customized toolbars that provide a quick access to the options available under the menus. To the left is the Scenario Tree Viewer. On startup, a list of available scenario names is provided from the server. A tree displaying the list of scenarios is populated and displayed under this view. On startup, these parts are empty and they are populated only when there is an active scenario: To the right - the Node Outline View On the bottom- the Properties and Problems Views In the center - the Scenario Graphical Editor.

16 / 94

3BK 21314 AAAA PCZZA Ed.10

2 Start Diagnosis Editor

2.3 Display Scenario


Once the Diagnosis Editor is up and running, the Scenario Tree View is populated with the list of available scenarios. Displaying a scenario involves: Displaying the Scenario Nodes as saved by the user in the Graphical Editor Displaying each nodes code and properties Populating the Outline and Properties View based on the Users context of interaction.

Note:

Only the code for the nodes that belong to the current scenario appears. The maximum number of scenarios that can be opened in the Scenario Graphical Viewer is configurable. To display a scenario: 1. Select a Scenario from the Scenario Tree View. 2. Perform one of the following actions: From the menu bar, select Scenario->Display scenario, or Right click on the Scenario. Then, from the popup menu, select Display Name of Scenario, or Double click on the Scenario, or Click on the icon from the toolbar, or

Press [ CTRL ] + [ D ]. The following figure shows the menu option to display a scenario: , where V2_DR is the scenario name.

2.4 Close Diagnosis Editor


To close the Diagnosis Editor: 1. Select Scenario->Exit. If there are any unsaved scenarios, a dialog box listing the scenarios that need to be saved appears. 2. Check the appropriate scenarios that need to be saved. 3. Click on [ OK ].

3BK 21314 AAAA PCZZA Ed.10

17 / 94

2 Start Diagnosis Editor

2.5 Diagnosis Editor


This section describes the Diagnosis Editor graphical user interface. It describes the layout of different parts within the "Diagnosis Editor" window.

Figure 4: Diagnosis Editor

2.5.1 Scenario Tree View


The Scenario Tree View displays the list of available scenarios. Scenario names are displayed at the root level of the tree if a Family is not defined. Usually, scenarios are grouped on the basis of Family / Sub Family. To view the to expand the tree. All the scenarios scenarios from a family, click on + from . grouped within that family are displayed in a tree and the icons change into Each scenario has an associated icon that represents whether the Scenario is a System Scenario or Customer Scenario. Icon Description If the scenario is a system scenario supplied by Alcatel-Lucent. If the scenario is created by customer and it belongs to customer dictionary. If the scenario is created by customer and it is not validated. If the scenario is a system scenario and not validated. Table 1: Icons for Scenario Tree View A scenario is available in the Analysis Desktop and can be executed only when it is validated. A single click selection of a scenario in Scenario Tree View does not imply that the Scenario appears in the Scenario Graphical Viewer. Similarly, a scenario

18 / 94

3BK 21314 AAAA PCZZA Ed.10

2 Start Diagnosis Editor

selected in the Scenario Graphical Viewer does not imply that the respective scenario is selected in the Scenario Tree View. By default, the Scenario Tree View part appears to the left of the Diagnosis Editor. When Link with Editor menu item from the Scenario Tree Toolbar is enabled: Selecting any scenario in the Scenario Tree would bring to the front the corresponding Graphical Editor for that scenario (if the scenario is currently opened) On Changing tabs between the Graphical Editor, the corresponding scenario name is selected in the Scenario Tree View.

2.5.2 Node Outline View


The Node Outline View displays a list of nodes available for the current active scenario. It provides quick access to the nodes related to the current scenario. If there are no opened scenarios, this view is empty.

Figure 5: Node Outline View Available nodes are displayed in a list view format, in this order: First Node Standard Nodes in alphabetical order External Nodes in alphabetical order. Each node has a related icon representing the node type, as follows: Type First Node Icon Displayed String Node_Name

Node

Node_Name

External Node

External_Scenario_Name.Node_Name

By Default, the Node Outline View appears to the right of the Diagnosis Editor. Once the Node Code Editor is opened for editing a node code, the Node Outline View displays the libraries and the variables defined for the node.

3BK 21314 AAAA PCZZA Ed.10

19 / 94

2 Start Diagnosis Editor

Figure 6: Node Outline View It is now possible to: Sort the elements alphabetically, by clicking on Hide the comments, by clicking on Hide the libraries, by clicking on Collapse all, by clicking on Expand all, by clicking on .

2.5.3 Property View


Property View displays all properties linked to a Scenario, a Node or a Link. The properties view gets populated based on the context of user operation. If a scenario is opened and no nodes are selected in the scenario, then the property view displays the details related to the scenario. If a node is selected in the Scenario Graphical Editor or in Node Outline View, then it displays the properties of the node. If a link between two nodes is selected, then the properties for the link are displayed. By default, the Property View appears at the bottom of the Diagnosis Editor.

Figure 7: Property Toolbar When selecting the first icon from the Property Toolbar, a two option window opens that allows the user to select the type of properties to display: Show Categories Show Advanced Properties.

20 / 94

3BK 21314 AAAA PCZZA Ed.10

2 Start Diagnosis Editor

2.5.3.1 Node Property


If a node is selected in the Scenario Graphical Editor or in Node Outline View, the node details are displayed in the property view. If the user has editing rights, the user can edit node information in the property view by double clicking on the value field for the respective property. Name of the node, the Description and the X and Y coordinates can be modified. On changing any property, the Scenario Graphical Editor and Node Outline View are updated to reflect the changes.

Figure 8: Node Property

2.5.3.2 Link Property


If a link is selected in the Scenario Graphical Editor, the Link Rank appears in the Property View. If the user has the editing rights, the user can modify the Rank associated with that Link. Each link also has a property called Cut off associated with it, meaning that if the next node proves to be True, the evaluation of the scenario is immediately stopped (this is a find first root cause mechanism).

Figure 9: Link Property If the link is a link with iteration, along with the Rank, the property window also displays the Iteration List and the Iteration Variable.

Figure 10: Link with Iteration Property

3BK 21314 AAAA PCZZA Ed.10

21 / 94

2 Start Diagnosis Editor

2.5.3.3 Scenario Property


If neither a node nor a link is selected in the Scenario Graphical Editor and a node is not selected in the Node Outline View, the Property window displays the properties of the currently active scenario.

Figure 11: Scenario Property The operator cannot modify the scenario properties.

2.5.4 Problem View


If there are any errors / problems in the Diagnosis Node Code Editor, the Problem View displays these errors.

Figure 12: Problem View By default, Problem View appears at the bottom of the Diagnosis Editor. When selecting the icon from the Problem Toolbar, the following options allow the user to customize the Property View:

Figure 13: Property View Customizing To sort the errors, from the toolbar menu, select window, select the sorting criteria: Sorting and in the new open

Figure 14: Error Sorting Criteria

22 / 94

3BK 21314 AAAA PCZZA Ed.10

2 Start Diagnosis Editor

Errors can be sorted by these criteria (ascending or descending): Severity and Description / Path / Resource / Location / Creation Time / Id. To restore the default sorting criteria, click on [ Restore Defaults ]. To group errors, select Grouping and choose one of the following options: Type / Java Problem Type / Severity / None.

Figure 15: Error Grouping Criteria To select filters to be applied on the Problem view, from the Toolbar menu, select Filters. A list of available filters appears. Check the filters to apply. To configure filters, select the The following widow opens. icon from the Toolbar.

Figure 16: Filters To select one filter, check the box related to the filter. To select all filters, click on [ Select All ]. To deselect all filters, click on [ Deselect All ]. To add a new filter, click on [ New ] and in the window that opens, fill in the filter name, then click on [ OK ]. To remove a filter from the list, check the filter, then click on [ Remove ].

Note:

The default filter cannot be removed. Check the filter to configure, then: Select the type of elements on which the filter is configured: On any element On any element in the same project On a selected element only On a selected element and its children On a working set. To select one working set, click on [ Select... ] and in the window that opens, check one of the options: Window Working Sets / Selected Working Sets. If needed, the user can add new working sets.

3BK 21314 AAAA PCZZA Ed.10

23 / 94

2 Start Diagnosis Editor

If required, add a description of the filter type: Select comment Select comment. and fill in the following field with the appropriate

and fill in the following field with the appropriate

To filter errors of one type of severity, check the box attached to Where severity is, then check the box attached to the type of problem: Error Warning Info. To select the type of items, check the box(es) attached to the possible types (displayed to the right of the window). To select all types of items, click on [ Select All ]. To deselect all types of items, click on [ Deselect All ]. To restore the defaults characteristics of the filter, click on [ Restore Defaults ]. To limit visible items per group, from the Toolbar menu, select A new window opens, as shown in the following figure. Preferences....

Figure 17: Set Item Limits Check the Use marker limits field, fill in the number of visible items, then click on [ Ok ]. To restore defaults value (100 items / group), click on [ Restore Defaults ].

24 / 94

3BK 21314 AAAA PCZZA Ed.10

2 Start Diagnosis Editor

2.5.5 Scenario Graphical Editor


The Scenario Graphical Editor is one of the major components of the Diagnosis Editor, displayed in the center of the window, used to display the graphical representation of a Scenario (links and nodes). The Scenario Editor (Tab) title displays the name of the Scenario. An additional * appears if the current Editor was modified, as in the following example: . The* is not shown when the current Editor is saved. The Scenario is colored in: Orange Green , when it is a system scenario , when the scenario is created by customer.

As long as a scenario is not validated, it is marked with /.

Figure 18: Scenario Graphical Editor Nodes are displayed in the Scenario Graphical Editor using the representative icons. The Node name appears below the icon. Each node appears at its respective X and Y location, retrieved from its node property. On mouse-over the node, a tool-tip appears displaying following information about node: Mode name Mode description Mode code snipped (first 100 characters). For an external node, only the node name appears on mouse-over the node.

3BK 21314 AAAA PCZZA Ed.10

25 / 94

2 Start Diagnosis Editor

Figure 19: Node tooltip example Multiple nodes can be selected in the Scenario Graphical Editor by holding down the [ Ctrl ] or [ Shift ] keys and clicking on various nodes or pressing the left mouse button and dragging the selection box over the nodes to be selected.

Note:

For a node to be selected, the node should be completely within the bounding selection rectangle. For example, in the following figure, six nodes are selected.

26 / 94

3BK 21314 AAAA PCZZA Ed.10

2 Start Diagnosis Editor

2.5.5.1 Links
Links are also known as connections. The link orientation defines the causality between two nodes (which node is the cause, which node is the consequence). A consequence node can have several causal nodes. Links between nodes are directed to visually represent the flow of execution. Rank associated with links decides the order of execution of casuality nodes. The link can also carry an iteration variable enabling to test the next node on a set of variables (for neighbor or adjacency checks provided a given cell for instance). Links with iteration are represented using dotted blue directed lines. Links can also be defined as cutoff, meaning that if the causal node proves to be true, the evaluation of all sibling nodes is skipped. Rank of a cutoff link is display in pink color.

Figure 20: Links and links with iteration in Scenario Graphical Editor.

3BK 21314 AAAA PCZZA Ed.10

27 / 94

2 Start Diagnosis Editor

2.5.5.2 Fly-out Palette


The Fly-out Palette allows the user to: Select a Node/Link Create new Nodes/Links. Normal Icon 16x16 Large Icon 32x32 Displayed String without Details Displayed String with Details

Link Link with iteration Node

Link - Create a Link Link with iteration - Create a Link with iteration Node- Create a node

First Node

First Node- Create a first node

External Node

External Node- Create an external node

Table 2: Icons for Fly-out Palette

Figure 21: Fly-out Palette Right clicking on the Fly-out Palette provides the user with the following options: Change the Layout to Columns, List, Icons Only and Details Display Large Icons Change Settings Pinned. If unchecked, the palette hides itself when the cursor moves out of the palette area.

28 / 94

3BK 21314 AAAA PCZZA Ed.10

2 Start Diagnosis Editor

To change the settings of the Fly-out Palette, click on Settings. A dialog box appears.

Figure 22: Fly-out Palette Settings The following settings are available. Font To change the "Diagnosis Editor" window Dialog Font, . A new window opens, which allows click on user to change the settings. To come back to the system default font settings, click on . Layout To change the Layout to Columns, check the Columns field. To change the Layout to List, check the List field. When set to List, Layout can use large icons, when the Use large icons field is checked. To change the Layout to Icons only, check the Icons only field. To change the Layout to Details, check the Details field. Drawer options Always close when opening another drawer. Always close when opening another drawer. Never close.

By default, the Fly-out Palette appears to the right of the Scenario Graphical Editor. To change the position of the Palette, right click on Palette and select Dock on> Left. To resize the Palette, right click on Palette and select Resize.

3BK 21314 AAAA PCZZA Ed.10

29 / 94

2 Start Diagnosis Editor

2.5.6 Node Code Editor


The Pydev Editor is a plug-in that enables users to use Eclipse for Python development in order to write node code. Features like code completion, syntax highlighting, syntax analysis, debug traces are available. The following icon is used in the heading for the Node Code Editor: .

Editing node code opens a new Node Code Editor in place of the Scenario Graphical Editor. The user can switch between the editors by means of the tabs.

Figure 23: Editing Node Code in Scenario graphical Editor. In the case of a scenario, the Editor (Tab) title displays the name of the Scenario, while editing a nodes code the Editor title displays the name of the corresponding Node. An additional * appears if the current Editor has been modified. The* is not shown if the current Editor is saved. The Python libraries are used in the node code definition when the user wants to access to a QoS indicator, a parameter value, or to navigate in the topology. The QoS and parameters libraries are generated by the offline tools at dictionary imports. Only the topology navigation are hard coded. The use of the libraries allows completion when typing a indicator or parameter value. By default, the Node Code Editor appears in the center of the Diagnosis Editor.

30 / 94

3BK 21314 AAAA PCZZA Ed.10

2 Start Diagnosis Editor

2.5.7 Menubar, Toolbar and Popup Menu


Note:
When the user (even if the user is the Administrator) does not have a particular license for a feature, then all the popup menus, menu bar menus, toolbar items related to that feature are disabled.

2.5.7.1 Menu Bar


The following figure shows the menu bar.

Figure 24: Scenario Menu The following table lists the scenario menu items and their corresponding descriptions. Scenario Menu Item Scenario New Scenario Copy Scenario Name of Scenario... Display Name of Scenario Save Name of Scenario Description Accelerator

Opens the submenu under Scenario Menu Item Creates a new Scenario Copies the selected Scenario Grayed when no scenario is currently selected Displays the Scenario Grayed when no scenario is currently selected Save the currently opened Scenario Grayed when no scenario is currently opened or when no changes have been made to the scenario since last save Displays properties of the selected scenario in a wizard Grayed when no scenario is currently selected

Alt + S Ctrl + N

Ctrl + D

Ctrl + S

Properties of Name of Scenario

Ctrl + Enter

Validate/Invalidate Validates/Invalidates the currently opened scenario Name of Grayed when no scenario is currently opened or when the user does not Scenario have privilege to modify selected scenario Delete Deletes the selected Scenario Grayed when no scenario is currently selected or when the user does not have privilege to delete selected scenario Exit Exits Diagnosis Editor Alt +F4

3BK 21314 AAAA PCZZA Ed.10

31 / 94

2 Start Diagnosis Editor

The following figure shows the Node menu.

Figure 25: Node Menu Node Menu Item Node Create Node Description Accelerator

Opens the submenu under Node menu item Create a new node in the currently opened scenario Grayed when the user does not have the privilege to modify the current scenario Ctrl + 2

Create First Node

Creates a new First Node in the currently open scenario Grayed when the user does not have the privilege to modify the current scenario or when a First Node already exists in the current scenario Creates a new External Node in the currently open scenario Grayed when the user does not have the privilege to modify the current scenario Opens PyDev Editor with the node code of the currently selected node Grayed when no node is selected Deletes the currently selected Node Grayed when the user does not have the privilege to modify the current scenario or when no nodes are selected

Ctrl + 1

Create External Node Edit Node Code Delete

Ctrl + 3

Ctrl + D

Ctrl + Delete

Copy Node

Copies the currently selected Node Grayed when no nodes are selected

Ctrl + Shift + C Ctrl + Alt + V

Paste Node as ...

Pastes the copied node in the current scenario Grayed when the user does not have the privilege to modify the current scenario or when no node was previously copied Arranges all the nodes in the current scenario in a tree form Grayed when the user does not have the privilege to modify the current scenario or when a node is selected

Auto Layout

Shift + F5

32 / 94

3BK 21314 AAAA PCZZA Ed.10

2 Start Diagnosis Editor

The following figure shows the Help menu.

Figure 26: Help Menu Item

2.5.7.2 Toolbar
The icons on the Toolbar display associated tool tips specifying the meaning of the icon when mouse is moved over them, as described in the following table.

Icon

Description New Scenario Copy Scenario Display Scenario Save Scenario

Grayed when ... Never No scenario is currently selected No scenario is currently selected No scenario is currently opened or no changes made since last save

Validate/Invalidate No scenario is currently opened or user is not privileged to modify selected Scenario scenario Delete Scenario No scenario is currently selected or user is not privileged to delete selected scenario The user is not privileged to modify the current scenario or a node is selected The user is not privileged to modify the current scenario The user is not privileged to modify the current scenario or a First Node already exists in the current scenario The user does is not privileged to modify the current scenario

Auto Layout Create new Node Create new First Node Create new External Node Edit Node Code Delete Node Copy Node Paste Node

No node is selected No node is selected or user is not privileges to delete the current node No node is selected The user is not privileged to modify the current scenario or no node was previously copied

3BK 21314 AAAA PCZZA Ed.10

33 / 94

2 Start Diagnosis Editor

2.5.7.3 Popup Menus Note:


All popup menus are context sensitive. Menu items are present / enabled / disabled, based on the current context.

Figure 27: Context Menu on Scenario Tree Viewer

Note:

If there are no scenarios selected when the user right clicks on the Scenario Tree View, all options on the context menu, except Create Scenario under the new menu, are disabled.

Figure 28: Context Menu in Scenario Graphical Editor

Figure 29: Node Context Menu in Graphical Editor In the last two popup menus, option Create First node appears only when the first node does not exist (it is deleted).

Figure 30: Context Menu on Property View - Key and Value

Figure 31: Context Menu on Property View - Value and Key

Figure 32: Context Menu on Indicator Association in Scenario Wizard

34 / 94

3BK 21314 AAAA PCZZA Ed.10

2 Start Diagnosis Editor

Figure 33: Context Menu on View Bar

Figure 34: Context Menu on Editor Bar

2.5.8 Customizing
You can maximize or minimize all Views and Editors, by clicking on one of the : two buttons situated in the top right corner of each window To minimize the window, click on To maximize the window, click on To restore the window, click on This option is available only if one of the first two was selected. To modify the size of each window, drag and drop the splitters that separate the windows. All windows can be moved from the default position. To move views, from the popup menu of the views, select: Move-> View to move one view Move-> Tab Group to move both Property View and Problem View. To move editors, from the popup menu of the Scenario Graphical Editor, select: Move->Editor to move one editor Move-> Tab Group to move all editors opened.

3BK 21314 AAAA PCZZA Ed.10

35 / 94

2 Start Diagnosis Editor

36 / 94

3BK 21314 AAAA PCZZA Ed.10

3 Scenarios

3 Scenarios
This section describes the ways that a scenario can be manipulated by the system.

3BK 21314 AAAA PCZZA Ed.10

37 / 94

3 Scenarios

3.1 The Scenario Tree


A diagnosis scenario is a formal description of a causal graph expressed as a linked set of nodes. Each node provides code that implements checks in order to evaluate the possible cause of a problem. The maximum number of nodes in a scenario is limited (to 150 nodes). There are three types of nodes: The first node Appears at the beginning of a scenario and is the entry point of the scenario execution. A scenario must have a first node.Only one first node is accepted. The classic node This is the basic node. There can be as many basic nodes as required. The external node Represent a node from another scenario. Nodes are associated by means of links. A link is oriented from a consequence node to a causal node. A consequence node can have several causal nodes. A link contains the variable associations between the casual and consequence nodes. There are two types of links: The classic link The link with iteration, list and variable. The arrow of the links differs depending on the link type. The NPO concept of the Availability domain is reused to specify on which object types the scenarios are valid at each temporal level. The availability domain is defined by the scenario developer. A diagnosis scenario can reference a QoS indicator that semiautomatically triggers the execution of the scenario on the threshold crossing. If no reference indicator was set, the execution of the scenario can be triggered through a manual Network Object selection operation in the Analysis Desktop. The maximum number of Network Objects in the execution context is configurable. Diagnosis is the process of execution of a scenario applied on an initial context. A diagnosis can be executed: On one object The textual output describes probable failure cause and possible remedy. On a set of objects. The output provides the list of objects which were identified by the scenario. The intent is to select cells candidate for further analysis. Diagnosis scenario result reports are provided in a synthetic or detailed way depending on the execution mode.

38 / 94

3BK 21314 AAAA PCZZA Ed.10

3 Scenarios

Execution Modes/Context The Detailed Mode launches a diagnosis execution, specified by the user, on a single network object, at a specific date, for a given periodicity, with a given QoS requirement level (taken from the current working zone). This mode is used to interactively launch the diagnosis from the NPO application. An HTML report is generated. The Synthetic Mode is available for one or many network objects (with parameter associated), and optionally with a date and a periodicity if the input context contains the corresponding variables. The QoS requirement level is required if a date and periodicity are given. This execution mode is similar to a classical view execution for QoS or Parameter in the NPO. The Analysis Desktop basically displays a matrix of Boolean values, but it can also return string values with the status. The Synthetic mode implies that the diagnosis execution stops at the first detected problem. The Tuning Session Mode is used to launch the execution of specific scenarios (called complex rules) that are used to check parameter validity. For more information about the execution of a scenario, refer to Execute Scenario from the NPO User Guide.

3.2 Create Scenario


To create a new scenario: 1. Perform one of the following actions: From the menu bar, select Scenario->New Scenario..., or Right click in the Scenario Tree View and select Scenario->New Scenario..., or Click on the icon from the toolbar, or

Press [ CTRL ] + [ N ]. Use the two page wizard with default values and editable fields that appears (see below) to set up the mandatory preconditions of a scenario.

Figure 35: Create Scenario Wizard A default scenario name is populated based on the current user. The title area displays messages / errors, if any, while creating a scenario.

3BK 21314 AAAA PCZZA Ed.10

39 / 94

3 Scenarios

2. Fill in the appropriate fields, as described in the following table. Field Name Scenario Name Owner Access Dictionary Description Name of Scenario to create must be unique. Read-only No Default Value Scenario_<owner>_n

The name of the user who creates the scenario. Access rights for Public or Private Dictionary to which the scenario belongs. (Always a customer dictionary in create mode). Scenario type (Diagnosis or Complex rule) Displays whether the scenario is a system scenario. Note:Creation of system scenarios via editor is not supported.

Yes No Yes Private Current Dictionary Name Diagnosis Unchecked

Type System

No Yes

Severity

Error or Warning Flag, used to discriminate the complex Yes, if rules (Tuning checks) diagnosis scenario Checked, if this scenario is visible in the Analysis Desktop. Unchecked, if this scenario is not visible in the Analysis Desktop except by the Administrator. No Checked

Visible

Validated

Displays whether the user has considered that this scenario is correct and executable. Operator description for node Contains the list of object types from which the user can choose. The items in the list are based on the following rules: If the Type is Complex Rule, all the Object Type in the System are available If the Type is Diagnosis then it displays the object types of those modes for which scenario creation is allowed.

Yes

Unchecked

Description Availability Domain Object Type

No No

Availability Domain - H Availability Domain - D Availability Domain - W Availability Domain - M

A Tooltip mentioning Hourly appears

No

Unchecked

A Tooltip mentioning Daily appears

No

Checked

A Tooltip mentioning Weekly appears

No

Unchecked

A Tooltip mentioning Monthly appears

No

Unchecked

40 / 94

3BK 21314 AAAA PCZZA Ed.10

3 Scenarios

3. If needed, add the appropriate Families. An indicator can belong to a family and sub-family hierarchy. Up to four depths of sub family are currently supported. The table cells are editable dropdown lists, proposing the existing values and it allows the user to add new values. A scroll bar appears if needed. Add new rows by right clicking on a cell and selecting Add Row. Once the mandatory fields are filled in, the [ Next ] and the [ Finish ] buttons are enabled. 4. Click on [ Next ]. The "Trigger Association Page" appears, based on the scenario type selected. For scenario type Diagnosis, the "Trigger Association Page" appears, as shown in the following figure.

A tree containing the list of available Indicators associated with the selected object type appears. For scenario type Complex Rule, the "Trigger Association Page" appears, as shown in the following figure.

3BK 21314 AAAA PCZZA Ed.10

41 / 94

3 Scenarios

5. For scenario type Diagnosis, double click on an Indicator from the Indicator Tree to set the selected Indicator.

Note:

To clear the currently selected Indicator, click on [ Clear ]. To search for an indicator: From the popup menu, select Search Fill in the Indicators name in the new window opened and if needed, check one of the search options Click on [ Find Next ].

For scenario type Complex Rule, click on [ Add... ] to set the Parameter. A new window opens (see the following figure), displaying the parameters divided in two trees: Design Parameters Logical Parameters.

6. For scenario type Complex Rule, double click on a Parameter from one of the lists. 7. Click on [ OK ]. The "Associate Parameter(s) with Scenario" window closes.

Note:

Click on [ Remove ] to remove the currently selected Parameter. 8. Click on [ Finish ]. The scenario is created.

42 / 94

3BK 21314 AAAA PCZZA Ed.10

3 Scenarios

3.3 Create Scenario by Copy


To copy a scenario: 1. From the Scenario Tree View, select a scenario to copy. 2. Perform one of the following actions: From the menu bar, select Scenario->Copy Scenario <Name of Scenario>..., OR Right click and select from the popup menu Scenario->Copy Scenario <Name of Scenario>..., OR Click on icon from the toolbar.

A question dialog windows appears informing that the external nodes are not copied.

3. Click on [ Yes ]. If the scenario is not currently open in the Graphical Editor, a progress bar appears while the scenario information is retrieved from the server.

Figure 36: Awaiting server response Once the scenario information is retrieved, a two page wizard appears (one page after the other), as shown in the following figure.

3BK 21314 AAAA PCZZA Ed.10

43 / 94

3 Scenarios

All the scenario properties are copied, and the following properties are changed by default: The name of the scenario to oldname_copy_n, where oldname is the name of the scenario being copied and n is the copy number The owner is set to the current user name Access rights are set to Public. 4. To modify any Scenario Properties, see Create Scenario (Section 3.2). 5. Click on [ Finish ]. The scenario details are updated only in the local files. The scenario must be saved for it to be reflected on the server.

3.4 Edit Scenario/Scenario Properties


To edit a scenario or scenario properties: 1. From the Scenario Tree View, select a scenario to edit. 2. Perform one of the following actions: From the menu bar, select Scenario-> Properties of <Name of Scenario>..., or Right click on the scenario and, from the popup menu, select Scenario-> Properties of <Name of Scenario>..., or Press [ CTRL ] + [ Enter ]. If the scenario is not currently open in the Graphical Editor, a progress bar appears to the user while the scenario information is retrieved from the server.

Figure 37: Dispatching Request to Get Scenario Information Once the scenario information is retrieved, a two page wizard appears (one page after the other) for editing the scenario properties.

44 / 94

3BK 21314 AAAA PCZZA Ed.10

3 Scenarios

Figure 38: Edit Scenario Wizard If the scenario is not currently open in the graphical editor (or if the user does not have the privilege to modify the selected scenario), the wizard displays scenario properties with all fields disabled. A user can edit the scenario if: The scenario is not a system scenario, if the user is the owner of the scenario, and if the scenario is not currently locked by another user The user is an administrator and the scenario is not currently locked by another user. 3. Edit the required Scenario Properties, if any (only fields that are enabled); see Create Scenario (Section 3.2). 4. Click on [ Finish ]. The scenario details are updated only in local files. The scenario must be saved for it to be reflected on the server.

3.5 Save Scenario


To save a scenario: 1. From the Scenario Tree View, select a scenario to save. 2. Perform one of the following actions: From the menubar, select Scenario->Save <Name of Scenario>, or Click on icon from the toolbar.

An information message appears:

3. Click on [ OK ]. The scenario is saved.

3BK 21314 AAAA PCZZA Ed.10

45 / 94

3 Scenarios

3.6 Validate/Check Scenario


Before marking a scenario as validated, all nodes must be checked to detect syntax error, undefined functions or invalid parameters. A scenario that is not validated is not be visible in Analysis Desktop and cannot be executed.

Note:

Only saved scenario can be marked as validated. A scenario that is linked with an invalid scenario must be tagged invalid. After validating a scenario, if Diagnosis Scenario window was already opened in Analysis Desktop, perform a Refresh All action. To validate a scenario: 1. From the Scenario Tree View, select a scenario to validate. 2. Perform one of the following actions: From the menubar, select Scenario->Validate <Name of Scenario>..., or Click on the icon from the toolbar.

A question dialog appears.

3. Click on [ Yes ]. An information message appears:

4. Click on [ OK ]. The scenario is validated. The following modifications to a Validated scenario automatically mark the scenario as Invalid: Adding / Deleting Nodes / Links Editing Node Code Modifying Scenario Properties.

46 / 94

3BK 21314 AAAA PCZZA Ed.10

3 Scenarios

3.7 Delete Scenario


To delete scenario: 1. From the Scenario Tree View, select a scenario to delete. 2. Perform one of the following actions: From the menubar, select Scenario->Delete, or Right click on the scenario and select from the popup menu: Scenario->Delete, or Click on the icon from the toolbar left side.

A question dialogue appears.

3. Click on [ Yes ]. If the scenario had been opened in the Graphical Editor, the associate editors (including Node Code Editor) close. The scenario is deleted and removed from the Scenario Tree View.

3.8 Create Node


Note:
By default, the a suggested node name appears. Node names must be unique. A scenario must have a first node. Only one first node is accepted.

3.8.1 First Node


To create the first node: 1. Perform one of the following actions: From the menubar, select Node->Create First Node, or Right click in the Scenario Graphical Editor and, from the popup menu, select Node->Create First Node..., or Click on the icon from the Fly-out Palette, then click in the Scenario Graphical Editor, or Click on the icon from the toolbar, or

Press [ CTRL ] + [ 1 ]. The following dialog box appears.

3BK 21314 AAAA PCZZA Ed.10

47 / 94

3 Scenarios

2. Fill in the following fields: Name with the name for the first node Description a short description of the node. 3. Click on [ OK ]. The first node is created and displayed in the Scenario Editor and in the Node Outline View.

3.8.2 Node
To create a standard node: 1. Perform one of the following actions: From the menubar, select Node->Create Node, or Right click in the Scenario Graphical Editor and, from the popup menu, select Node->Create Node..., or Right click in the Node Outline View and, from the popup menu, select Node->Create Node..., or Click on the icon from the Fly-out Palette, then click in the Scenario Graphical Editor, or Click on icon from the toolbar, or

Press [ CTRL ] + [ 2 ]. The following dialog box appears.

2. Fill in the following fields: Name with the name for the first node Description with a short description of the node. 3. Click on [ OK ]. The node is created and displayed in the Scenario Editor and in the Node Outline View.

48 / 94

3BK 21314 AAAA PCZZA Ed.10

3 Scenarios

3.8.3 External Node


To create an external node: 1. Perform one of the following actions: From the menubar, select Node->Create External Node, or Right click in the Scenario Graphical Editor and, from the popup menu, select Node->Create External Node..., or Right click in the Node Outline View and, from the popup menu, select Node->Create External Node..., or Click on the icon from the Fly-out Palette, then click in the Scenario Graphical Editor, or Click on the icon from the toolbar, or

Press [ CTRL ] + [ 3 ]. The following dialog box appears.

For Auto completion, press at the same time the [ CTRL ] +[ Space ] keys: When the Name field is empty When the . is entered. 2. Fill in the Name field with the following: External scenario name . Its node name. An example of an external node name is: V2_DR_Copy.V2_DR_Copy_Problem of unsuccessful Directed retry. 3. Click on [ OK ]. The node is created and displayed in the Scenario Editor and in the Node Outline View.

3BK 21314 AAAA PCZZA Ed.10

49 / 94

3 Scenarios

3.9 Edit Node Properties


Once a node is selected, node properties are updated in the "Property View".

Figure 39: Node Property To edit node properties, double click on the property value in the Value Column for: Node Name Description X and Y coordinate. Only these fields are editable. Fill in the new values. To save the new properties, click on [ Enter ].

3.10 Edit Node Links


A link is oriented from a consequence node to a causal node. A consequence node can have several causal nodes. There are two types of links: The classic link The link with iteration list and variable, meaning that the following node must be evaluated one time for each value of this iterator. The arrow of the links differs depending on the link type. Links can be defined as cut off, meaning that if the next node proves to be true, the evaluation of the scenario is immediately stopped. A link between two nodes is invalid, in fact it cannot be created and a message appears to the operator in the following cases: The new link creates a loop within the scenario (inter scenario loops are checked on save) The target node is the First Node The source node is an External Node.

3.10.1 Link
To create a new link: 1. In the Fly-out Palette in the Scenario Graphical Editor, click on Create a link. The cursor is updated to indicate that a link is selected.

50 / 94

3BK 21314 AAAA PCZZA Ed.10

3 Scenarios

2. Move the cursor in the Scenario Graphical Editor Node Area (white area) and put it over a node. The node selected is called Cause node. 3. Move the mouse to the target node (Consequence node). A link is made on the fly. 4. If the consequence node is valid, a dialog box to set link properties appears.

Figure 40: Link Properties Note that the Cause node name and the Consequence node name are displayed in the dialog box. 5. Fill in the Rank of the node with the appropriate value ( a default value appears). 6. If the link created is a cutoff link, then check the Cutoff field. 7. Click on [ OK ]. The link is created and reflected with a directional line between the two nodes ( from the cause node to the consequence node). The rank of the link appears closed to the target node (it is indicated in pink if the Cutoff field was checked).

3.10.2 Link with Iteration


To create a new link with iteration: 1. In the Fly-out Palette in the Scenario Graphical Editor, click on Link With Iteration. The cursor is updated to display that a link is selected. 2. Move the cursor in the Scenario Graphical Editor Node Area (white area) and put it over a node. The node selected is called Cause node. 3. Move the mouse to the target node (Consequence node). A link is made on the fly. 4. If the consequence node is valid, a dialog box to set link properties appears.

Figure 41: Link with Iteration Properties Note that the Cause node name and the Consequence node name are displayed in the dialog box. 5. Fill in the Rank of the node with the approbate value (a default value appears).

3BK 21314 AAAA PCZZA Ed.10

51 / 94

3 Scenarios

6. If the link created is a cutoff link, then check the Cutoff field. 7. Fill in with the appropriate value: Iteration List Iteration Variable. 8. Click on [ OK ]. The link is created and reflected with a directional dotted blue line between the two nodes (from the cause node to the consequence node). The rank of the link appears closed to the target node (it is indicated in pink if the Cutoff field was checked).

3.10.3 Move a Link


To move a link: 1. Select the link. 2. Put the mouse on the extremity you want to move. 3. Drag the link to the new node.

3.11 Edit Link Properties


Once a link is selected, link properties are updated in the "Property View".

Figure 42: Link Property

Figure 43: Link Property To edit link properties, double click on the property value in the Value Column for: Rank Cutoff Iteration List ( in case of link with iteration) Iteration Variable ( in case of link with iteration). Only these fields are editable. Fill in the new values. To save the new properties, click on [ Enter ].

52 / 94

3BK 21314 AAAA PCZZA Ed.10

3 Scenarios

3.12 Copy Node


Note:
When copying a Node, the Nodes link and node position are not copied. Only the node description and node code are copied. To copy a node: 1. In the Scenario Graphical Editor, select a node to copy. 2. Perform one of the following actions: From the menubar, select Node->Copy Node, or Right click and, from the node popup menu, select Copy Node, or Click on the icon from the toolbar.

3. In the Scenario Graphical Editor, perform one of the following actions: From the menubar, select Node->Paste Node As..., or From the popup menu, select Paste Node as..., or Click on the icon from the toolbar.

A new dialog box opens that allows the user to select the type of node to paste (by default standard node).

Note:

Pasting a node as a First Node is possible only when the scenario does not already have a first node. To paste node as an External Node, paste the node as an external node linking to the scenario from which it was copied. Pasting a node as an External Node is possible only when: The current scenario is not the same as the copied node scenario, and The copied node scenario is not a system scenario. 4. Select the type of node, then click on [ OK ]. If the node type selected is External Node, an external node linking to the scenario the node was copied from is created in the existing scenario. Alternatively, the "Create new node" dialog box opens.

3BK 21314 AAAA PCZZA Ed.10

53 / 94

3 Scenarios

By default, the fields are filled in: Name with the name of copied node_copy number Description with the short description of the copied node. 5. Fill in the two fields with the appropriate values, then click on [ OK ]. The node is copied and pasted and displayed in the Scenario Graphical Editor and Node Outline View.

3.13 Delete Node/Link


To delete a node/link: 1. In the Scenario Graphical Editor, select a node/link to delete. 2. Perform one of the following actions: Only for node, from the menubar, select Node->Delete, or Right click in the Scenario Graphical Editor and, from the popup menu, select Delete, or Only for node, right click in the Node Outline View and, from the popup menu, select Node->Create Node..., or Click on the icon from the right side of the toolbar.

3. From the popup menu, select Delete. A new dialog box opens.

4. Click on [ OK ]. The node/link is deleted. If a node is deleted from a scenario, all the links associated to the node are also deleted (the scenario links and the links defined in other scenarios).

54 / 94

3BK 21314 AAAA PCZZA Ed.10

4 Edit Node Code

4 Edit Node Code


This section describes how to edit a node in the Node Code Editor and the telecom primitives.

3BK 21314 AAAA PCZZA Ed.10

55 / 94

4 Edit Node Code

4.1 Open Node Code Editor


To open the Node Code Editor: 1. Select the node to edit the code associated with it. 2. From the pop up menu, select Edit Node Code. The "Code Editor" window opens in the center of the Diagnosis Editor, in a switching tab with the Scenario Graphical Editor. If there is no code associated with the node, a new empty code is created and displayed, otherwise the node code is loaded in the Node Code Editor. The code is editable based on the FAD. If the user does not have the valid privileges, the Node Code editor is read-only. The Code Editor supports the following functions: Python Syntax highlighting Code Auto Completion Auto Indentation Libraries for tracing are provided Standard libraries for Indicators, Parameters and Topology Navigation are also provided.

Note:

The popup menu available in the Node Code Editor is not used for node code development.

4.2 Node Code Template


Most of the nodes follow the same structure as below: #import libraries import library_name # Define variable variable_name = library_name.primitive_template(parameter1,...,parameter n) # Test part if(variable_name == None): unknown("Report when it is not possible to evaluate the node") elif (condtion of a problem): pbfound("Report when a problem has been found") else: nopbfound("Report when no problem has been found")

All words that come after the hash character # are considered to be comments.

56 / 94

3BK 21314 AAAA PCZZA Ed.10

4 Edit Node Code

4.3 Import Libraries


The NPO Diagnosis Library defines telecom primitives that are predefined to build test expressions and node code. Primitives are functions that allow access to the data (indicators, parameter, topology object). They are available only when the related library is imported into the code. The libraries are imported in the Diagnosis Editor manually by the user each time a node code is developed, typing the command: import library_name Due to Python Syntax highlighting, the word import is always written in blue. The following table presents the library types. Library I_technology name Definition QoS Indicator for specified technology Example: I_GSM; P_WiMAX P_technology name Logical radio parameters and the radio network design for specified technology Example: P_GSM; P_WiMAX P_DN_technology name Logical radio parameters and the radio network design for specified technology; the primitive name is constructed with the displayed names Example: P_DN_GSM N N_Technology Generic topology primitives Navigation topology for a technology Example: N_GSM Generic set Filtering and generic primitives Manipulation of list

4.4 Define Variables


The template to define a variable is: variable_name = library_name.primitive_template(parameter1,...,parameter n)

All the parameters used to define a variable for a node code that are not specified are global and can be reused in its consequence node. They are also called initial context. Examples of global parameters are: object, the identifier of the network object given at the execution context object_list, the list of identifiers of all network object on which the diagnosis is executed.

3BK 21314 AAAA PCZZA Ed.10

57 / 94

4 Edit Node Code

bsc = N_GSM.BSCofOMC_R( object )

When executing the scenario, this expression returns the list of all BSC of the given OMC-R at the execution moment. The user can also define local parameters for a variable:
bsc = N_GSM.BSCofOMC_R( omcr19 )

When executing the scenario, this expression returns the list of all BSC of the OMC-R 19. To declare a variable: 1. In the command line, type: variable_name = library_name. A list appears, displaying all the primitives available for that library, in green.

The global parameter related to that primitive appears in parenthesis. If this list disappears, press [ Ctrl+ Space ] to reload the templates. The AutoCompletion feature provides primitives filters once you start typing in the command line to select an item from the dropdown list. Due to the huge number of telecom primitives, the word completion proposition appears only when there is a unique proposition. 2. Double click on the primitive to select it. 3. If needed, fill in the parameters related to that primitive with the appropriate value.

4.4.1 QoS Indicator and Parameter Primitives


4.4.1.1 Input Parameters for QoS Indicator Primitives
The global variable (object) is passed by default to the primitives for the QoS indicator. Once a primitive is selected, a textual description of the selected primitive appears to the right of the list.

The following expressions are equivalent:


Ratio_HO = I_GSM.SDCCH_drop_HO_ratio ( object ) Ratio_HO = I_GSM.SDCCH_drop_HO_ratio ( )

58 / 94

3BK 21314 AAAA PCZZA Ed.10

4 Edit Node Code

To call a QoS indicator with a context that is not the initial context, use the following syntax:
Ratio_HO = I_GSM.SDCCH_drop_HO_ratio ( value )

4.4.1.2 Input Parameters for Radio Parameter Primitives


By default, the operational value(s) of the radio parameter is (are) returned. Once a primitive is selected, a textual description of the selected primitive appears to the right of the list. The following expressions are equivalent:
P_GSM.TIMER_T11( ) P_GSM.TIMER_T11( object, OP).

The input parameters for radio parameters primitives are: object type The following table lists the possible syntax for the type parameter. Parameter Name OP REF REFMIN REFMAX P FC Meaning Operational Reference Reference Minimum Reference Maximum Planned Forecast

Note:

Usage of FC requires execution based on a Tuning Session, so it can only be used in a complex rule. Example: To get the minimal value of a design parameter, use the following syntax:
P_GSM.TIMER_T11(object, REFMIN)

To get the planned value of a design parameter, use the following syntax:
P_GSM.TIMER_T11(object, P)

3BK 21314 AAAA PCZZA Ed.10

59 / 94

4 Edit Node Code

4.4.2 Topology Navigation Primitives


The feature described in this section is not yet available for W-CDMA. These primitives provide facilities to navigate between related objects of the RNO data model. These primitives use the special prefix N. The generic primitives that allow navigation between Parent and Children Network Objects can replace most of these primitives. Adjacencies topology primitives (serving, target, neighbors) are also made accessible via a Python primitive. Navigation primitives use some cartographical distance computing for the interference computing. If no corresponding objects are found, the system returns empty object lists. The following table describes the existing NPO generic topology primitives. Name get_children_objects Definition Returns the children network elements related to the specified object for the specified technology. Returns the children network elements related to the specified objects for the specified technology. Parameters object technology object1 object2 technology get_parent_object Returns the parent network elements related to the specified object for the specified technology. Returns the object external Id Returns the object type. object technology object object

get_filtered_children_objects

getObjectExternalId getObjectType

For GSM technology, the prefix is N_GSM. Refer to the following sections for the proposed primitives.

4.4.2.1 BSC Navigation Primitives


This section is not applicable for W-CDMA.

Name BSCOfOMC_R Cells MFSOfBSC OMC_ROfBSC

Definition Returns the list of all BSCs that belong to the same OMC-R. Returns the list of all cells that belong to the given BSC. Returns the MFS of the given BSC. Returns the OMC-R of the given BSC.

Parameters object object object object

60 / 94

3BK 21314 AAAA PCZZA Ed.10

4 Edit Node Code

4.4.2.2 Cell Navigation Primitives


This section is not applicable for W-CDMA.

Name Adjancencies Adjancency FromServing AndTarget Ainterference Probability BSC BTS CellsInCircle

Definition Returns in a list the adjacencies for which the given cell is the serving cell Returns the adjacency from serving cell to target cell if it exists, or UNKNOWN.

Parameters object serving target

Returns the probability of interference between serving cell and target cell, considering that the two cells use adjacent frequencies (D(ARFCN) = 1). Returns the BSC of the cell. Returns the BTS of the cell. Returns the list of cells (possibly empty) that are located inside a circle of specified radius, centred on cell. Returns the list of cells that belong to the BSC of the given cell. Returns the list of cells that belong to the BTS of the given cell. For a split cell, the main BTS is considered. Returns the list of cells that belong to the MFS of the given cell.

serving target object object object a object object

CellsOfBSC CellsOfBTS

CellsOfMFS

object object object object1 object2 object object object object type object type

CellsOfOMC_R Returns the list of cells that belong to the OMC-R of the given cell. CellsOfRA Cinterference Probability LA MFSofCell OMC_RofCell ServingCells Returns the list of cells that belong to the Routing Area of the given cell. Returns the probability of interference between serving cell and target cell, considering that the two cells use the same (co-channel) frequency (D(ARFCN) = 0). Returns the Location Area of the cell. Returns the MFS of the cell. Returns the OMCR of the cell. Returns the list of serving cells of a given cell, considering either the planned adjacencies or the operational adjacencies of the network. Returns the list of target cells of given cell c, considering either the planned adjacencies or the operational adjacencies of the network.

TargetCells

3BK 21314 AAAA PCZZA Ed.10

61 / 94

4 Edit Node Code

Name TRXs

Definition Returns the list of TRXs of the cell.

Parameters object object index

TRXFromIndex Returns the TRX number of the cell (or UNKNOWN). TRX number must be an integer from 1 to n, n being the number of TRX in the cell (available with the primitive Number_Of_TRX).

4.4.2.3 Adjacency Navigation Primitives


This section is not applicable for W-CDMA.

Name Serving Target

Definition Returns the serving cell of the adjacency. Returns the target cell of the adjacency.

Parameters object object

4.4.3 Generic Library Related Primitives


Filtering primitives are provided to the user to permit the limitation of Network Objects number from a bigger number using selection criteria. One primitive is for filtering by QoS indicator values, and the other is for filtering by parameter values. These primitives are available once the Generic library is imported. Name FilterOnQoSIndicator Description Filters by QoS indicators value Parameters objectlist name testoperator thresholdvalue FilterOnParameter Filters by parameter value objectlist name testoperator thresholdvalue

The thresholdvalue is a numerical value. The object list represents the list of identifiers of all network object on which the diagnosis is executed. The list of operators that can be used in filtering is:

62 / 94

3BK 21314 AAAA PCZZA Ed.10

4 Edit Node Code

Operator > < = >= <= <>

Meaning Greater than Smaller than Equal Greater than or equal Smaller than or equal Not equal

3BK 21314 AAAA PCZZA Ed.10

63 / 94

4 Edit Node Code

Example: FilterOnQosIndicator(Ec1,"RTCH_duration_avg","=","0")

returns, from the cell list Ec1, a list of cells where the indicator RTCH_duration_avg = 0 for the given date and periodicity. FilterOnParameter(Ec1,"L_RXLEVMIN_UHL","<","-100")

returns, from the cell list Ec1, the list of cells where the parameter L_RXLEVMIN_UHL < -100. Also, the generic primitives that retrieve the data for indicators (customer indicators) and parameters (described below) are available once the Generic library is imported. Name get_indicator Description Retrieves the value of a given indicator for the object on which the scenario is executed Retrieves the values of a list of indicators in a single call for the given list of indicators for the objects on which the scenario is executed Retrieves the value of a given parameter for the object on which the scenario is executed Retrieves the value of a given parameter for the object on which the scenario is executed The given parameter name is the displayed name instead of system name get_parameter_for_tech_ Retrieves the value of a given parameter for the specifyed technology (by the displayed name) for the object on which from_displayed_name the scenario is executed The given parameter name is the displayed name instead of system name get_parameter_list Retrieves the value of a list of parameters in a single call for the given list of parameters for the objects on which the scenario is executed object name tech valueType parameter list object list tech valueType Parameters object name indicatorList objectList object name object name

get_indicator_list

get_parameter

get_parameter_from_ displayed_name

64 / 94

3BK 21314 AAAA PCZZA Ed.10

4 Edit Node Code

4.4.4 List Manipulation


Once the set library is imported, lists can be manipulated using the following primitives. Primitive difference(a, b) intersection(a, b) isin(element, l) issubset(a, b) union(a, b) Meaning Return the difference of two sets as a new set (i.e. all elements that are in set a and not in the other (b)). Return the intersection of two sets as a new set (i.e. all elements that are in both sets).

Report whether an element is a member of a set. (Called in response to the expression element in shelf.) Report if a is a subset of b (if every element of set a is also in set b. Return the union of two sets as a new set (i.e. all elements that are in either sets).

For example: list1 = Generic.FilterOnParameter(cells, "Class", "<>", "URBAN") list2 = Generic.FilterOnQosIndicator(cells, "Call_setup_success_rate", ">", "10") list3 = set.intersection(list, list2)

The first list filters and gets cells with Class different of URBAN. The second list gets cell with Call_setup_success_rate > 10. The third list gets only the cells with Class different of URBAN and Call_setup_success_rate > 10.

3BK 21314 AAAA PCZZA Ed.10

65 / 94

4 Edit Node Code

4.5 Test Syntax


use the Test field to enter the test expressions for the node. The conditional logic in Python is handled with the if statement: if(expression): pbfound("Report when a problem has been found") else: nopbfound("Report when no problem has been found") There can be none or more elif parts, and the else part is optional. The keyword elif is short for else if and is useful to avoid excessive indentation. The if statement can contain multiple condition. The operators between conditions can be and or if(condition1) or (condition2) if(condition1 and condition2) When a loop is declared on a link, the operator indicates the looping variable and the iteration list. The iteration list always and only contains network objects. Example: Test if the SDCCH dropped due to handover problems represent more than 40% of all SDCCH dropped.

Note:

In Diagnosis Editor the 10% value is seen as 0.1 value. In internal Diagnosis node code, multiply the indicator with 100 in its formula.

The possible execution results are: pbfound contains the messages associated with the error found in the nodes nopbfound contains the associated messages when no error is found in the nodes unknown contains the associated messages in case there is not enough information (empty list, null variables ...) to give a status for the node. It is not an obligation to have a pbfound or nopbfound in a node. In this case, the node is considered as green.

66 / 94

3BK 21314 AAAA PCZZA Ed.10

4 Edit Node Code

Execution Results messages are provided as string lists in order to allow providing multiple messages for a node. Example: Test if WAC is active.

As seen in the examples, the output message can also contain variables that are processed during execution.

The variables are indicated with %s symbol inside the message content. After the message, the ways to indicate variables are: % primitive_name % (str(<variable_name>)) . The primitive str() is used to convert a numeral to string. In case there are more than one variables declared inside the message content, after the message content the syntax is: % (variable_1 , variable_2, ... , variabile_n). Highlighting in View is applied for a Diagnosis Executed View (report view), with the following rules: Diagnosis result is unknown - orange

Diagnosis result is nopbfound - green

Diagnosis result is pbfound - red.

3BK 21314 AAAA PCZZA Ed.10

67 / 94

4 Edit Node Code

The diagnosis report is detailed in NPO User Guide.

4.6 Debug Traces


In order to detect problems, traces are used. The examples below show the trace syntax. bsc = N_GSM.BSC(object) # Get the BSC of the cell trace("The BSC is %s" % N.getObjectExternalId(bsc)) This prints the external ID of the BSC to which the cell selected in Analysis Desktop belongs. cells = N_GSM.Cells(bsc) # get all the cells of the bsc trace("BSC cells: %s" % str(cells)) This prints the cells of the BSC selected in Analysis Desktop. View the output of the traces by selecting, from the Report View, the Click here to view the trace hyperlink. A new window called "Diagnosis Execution Logs" opens, displaying the problems during execution:

Some traces can still appear in the window even if nothing is defined in case of execution exception.

68 / 94

3BK 21314 AAAA PCZZA Ed.10

5 Example Scenarios

5 Example Scenarios

3BK 21314 AAAA PCZZA Ed.10

69 / 94

5 Example Scenarios

5.1 V2_DR (GSM Technology) Scenario


The following figure shows the V2_DR scenario.

Figure 44: V2_DR Scenario This scenario is a system scenario that verifies why the Directed Retry feature is not working properly. Scenario properties appear in the Property View

The list of nodes appear in the Node Outline View, once the scenario appears.

70 / 94

3BK 21314 AAAA PCZZA Ed.10

5 Example Scenarios

5.1.1 Problem of unsuccessful Directed Retry


FIRST NODE: Problem of unsuccessful Directed Retry checks if there are too many failures during the outgoing Directed Retry. Node code:

5.1.2 Bad settings of Directed Retry parameters


NODE: Bad settings of Directed Retry parameters checks if Directed Retry parameters have a correct value. Node code:

3BK 21314 AAAA PCZZA Ed.10

71 / 94

5 Example Scenarios

5.1.3 Congestion on Potential Target Cell


NODE: Congestion on potential target cell checks if the Directed Retry procedure is unsuccessful because of congestion on a potential target cell. Node code:

5.1.4 Failures on Potential Target Cell


NODE: Failures on potential target cell checks if there are Directed Retry failures on a potential target cell. Node code:

5.1.5 Problem of external Directed Retry


NODE: Problem of external Directed Retry checks if failures happen during the external Directed Retry. Node code:

72 / 94

3BK 21314 AAAA PCZZA Ed.10

5 Example Scenarios

5.1.6 Problem of incorrect A_PBGT_DR


NODE: Problem of incorrect A_PBGT_DR checks if parameter A_PBGT_DR has a correct value. Node code:

5.1.7 Problem of incorrect FREE_LEVEL_DR


NODE: Problem of incorrect FREE_LEVEL_DR checks if the FREE_LEVEL_DR parameter has a correct value. Node code:

5.1.8 Problem of incorrect L_RXLEV_NCELL_DR


NODE: Problem of incorrect L_RXLEV_NCELL_DR checks if the L_RXLEV_NCELL_DR parameter has a correct value. Node code:

3BK 21314 AAAA PCZZA Ed.10

73 / 94

5 Example Scenarios

5.1.9 Problem of internal Directed Retry


NODE: Problem of internal Directed Retry checks if failures happen during an internal Directed Retry. Node code:

5.1.10 V4_TCONG.Bad settings of queuing parameters


EXTERNAL NODE: V4_TCONG.Bad settings of queuing parameters checks if queuing parameters have a correct value. Node code:

74 / 94

3BK 21314 AAAA PCZZA Ed.10

5 Example Scenarios

5.2 Scenario V2_SDROP(GSM Technology)

Figure 45: Scenario V2_DR This scenario is a system scenario that verifies why SDCCH channels are dropped during the signalization phase. Scenario properties are displayed in the Property View.

The list of nodes appear in the Node Outline View, once the scenario appears.

3BK 21314 AAAA PCZZA Ed.10

75 / 94

5 Example Scenarios

5.2.1 SDCCH drop


FIRST NODE: SDCCH drop tests if an excessive percentage of SDCCH channels were dropped during the signalization phase. Node code:

5.2.2 BSS internal problem


NODE: BSS internal problem checks if no LAPD, TCU and BTS/FU alarms are present. Node code:

5.2.3 Link failure


NODE: Link failure checks LAPD alarms with the following cause: \"link failures\", \"link re-establishment\". Node code:

5.2.4 Processor restart


NODE: Processor restart checks TCU alarms or BTS/FU alarms with the following cause: \"restart\", \"reset\", \"Access failure\". Node code:

5.2.5 SDCCH drop HO


NODE: SDCCH drop HO checks if SDCCH dropped are coming from a handover problem. Node code:

76 / 94

3BK 21314 AAAA PCZZA Ed.10

5 Example Scenarios

5.2.6 SDCCH drop radio


NODE: SDCCH drop radio checks if SDCCH dropped are coming from a radio problem. Node code:

5.2.7 SDCCH drop system


NODE: SDCCH drop system checks if SDCCH dropped are coming from a system problem. Node code:

5.2.8 SDCCH HO not activated


NODE: SDCCH HO not activated checks if handovers on SDCCH are activated. Node code:

3BK 21314 AAAA PCZZA Ed.10

77 / 94

5 Example Scenarios

5.2.9 Standalone SDCCH HO problem


NODE: Standalone SDCCH HO problem checks if there is no TCH call drop coming from a handover problem. Node code:

5.2.10 TCH HO problem


NODE: TCH HO problem checks if there is also a TCH call drop coming from a handover problem. Node code:

5.2.11 TCH radio problem


NODE: TCH radio problem checks if there is also a TCH call drop coming from a radio problem. Node code:

78 / 94

3BK 21314 AAAA PCZZA Ed.10

5 Example Scenarios

5.3 WAC Cluster Configuration (WiMAX Technology) Scenario

This scenario is a system scenario that verifies the WAC Cluster Configuration. Scenario properties appear in the Property View.

The list of nodes are displayed in the Node Outline View, once the scenario appears.

3BK 21314 AAAA PCZZA Ed.10

79 / 94

5 Example Scenarios

5.3.1 1st Node Description


FIRST NODE: 1st tests if macAddressBase is unique under a RAN. Node code:

80 / 94

3BK 21314 AAAA PCZZA Ed.10

5 Example Scenarios

5.3.2 2nd test Node Description


NODE: 2nd test checks if pagingGroupId is unique under a wac cluster. Node code:

3BK 21314 AAAA PCZZA Ed.10

81 / 94

5 Example Scenarios

5.3.3 3rd Node Description


NODE: 3rd checks if there is also a TCH call drop coming from a radio problem. Node code:

82 / 94

3BK 21314 AAAA PCZZA Ed.10

6 Introduction to Python

6 Introduction to Python

3BK 21314 AAAA PCZZA Ed.10

83 / 94

6 Introduction to Python

6.1 Getting Start with Python


Start the interpreter and wait for the primary prompt. In a terminal window, to the shell, type: python The interpreter prints a welcome message stating its version number and a copyright notice before printing the first prompt: three greater-than signs (">>> ") When commands are read from a tty, the interpreter is said to be in interactive mode. In this mode it prompts for the next command with the primary prompt, usually three greater-than signs (">>> "); for continuation lines it prompts with the secondary prompt, by default three dots ("... "). Input and output are distinguished by the presence or absence of prompts (">>> " and "... "): to repeat the example, you must type everything after the prompt, when the prompt appears; lines that do not begin with a prompt are output from the interpreter. Note that a secondary prompt on a line by itself in an example means you must type a blank line; this is used to end a multi-line command. Comments in Python start with the hash character, "#", and extend to the end of the physical line. A comment may appear at the start of a line or following whitespace or code, but not within a string literal. A hash character within a string literal is just a hash character. Here is an example: # this is the first comment SPAM=1 # and this is the second comment # ... and this is the third! STRING="# This is not a comment"

6.1.1 Numbers
The interpreter acts as a simple calculator: you can type an expression at it and it writes the value. Expression syntax is straightforward: the operators +, -, * and / work just like in most other languages (for example, Pascal or C); parentheses can be used for grouping. For example: >>> 2+2 4 >>> # This is a comment ...2+2 4 >>> 2+2 # and a comment on the same line as code 4 >>> (30-3*6)/3 4 >>> # Integer division returns the floor: ... 7/3 2 >>> 7/-3 -3 The equal sign ("=") is used to assign a value to a variable. Afterwards, no result appears before the next interactive prompt: >>> a=3 >>> b=3*10 >>> a+b 33

84 / 94

3BK 21314 AAAA PCZZA Ed.10

6 Introduction to Python

A value can be assigned to several variables simultaneously: >>> x=y=z=0 #x, y and z have the value 0 >>> x 0 >>> y 0 >>> z 0 There is full support for floating point; operators with mixed type operands convert the integer operand to floating point: >>> 3*1.5/2 2.25 Complex numbers are also supported; imaginary numbers are written with a suffix of "j" or "J". Complex numbers with a nonzero real component are written as "(real+imagj)", or can be created with the "complex(real, imag)" function. >>> 1j*1J (-1+0j) >>> 1j*complex(0,1) (-1+0j) >>> (1+2j)/complex(1,1) (1.5+0.5j) Complex numbers are always represented as two floating point numbers, the real and imaginary part. To extract these parts from a complex number z, use z.real and z.imag. >>> z=2.5+1.5j >>> z.real 2.5 >>> z.imag 1.5 The conversion functions to floating point and integer (float(), int() and long()) do not work for complex numbers. There is no one correct way to convert a complex number to a real number. Use abs(z) to get its magnitude (as a float) or z.real to get its real part. >>> z=3+4j >>> z.real 3 >>> float(z) Traceback (most recent call last): File "<stdin>", line 1, in ? TypeError: cant convert complex to float; use abs(z) >>> abs(z) #sqrt(z.real**2+z.imag**2) 5 In interactive mode, the last printed expression is assigned to the variable _. This means that when you are using Python as a desk calculator, it is somewhat easier to continue calculations, for example: >>> a=25 >>> b=0.025 >>> a+b 25.025 >>> round(_,2) 25.02 This variable should be treated as read-only by the user. Do not explicitly assign a value to it you would create an independent local variable with the same name masking the built-in variable with its magic behavior.

3BK 21314 AAAA PCZZA Ed.10

85 / 94

6 Introduction to Python

6.1.2 Strings
Besides numbers, Python can also manipulate strings, which can be expressed in several ways. They can be enclosed in single quotes or double quotes: >>> today is Monday today is Monday >>> doesn\t "doesnt" >>> "today is Monday" "today is Monday" >>> "\"today\" is Monday" "today" is Monday >>> "today\" is Monday "today\" is Monday String literals can span multiple lines in several ways. Continuation lines can be used, with a backslash as the last character on the line indicating that the next line is a logical continuation of the line: >>> hello = "This is a rather long string containing\n\ several lines of text just as you would do in C.\n\ Note that whitespace at the beginning of the line is\ significant." print hello Note that newlines still need to be embedded in the string using \n; the newline following the trailing backslash is discarded. This example would print the following: This is a rather long string containing several lines of text just as you would do in C. Note that whitespace at the beginning of the line is\ significant. If we make the string literal a raw string, however, the \n sequences are not converted to newlines, but the backslash at the end of the line, and the newline character in the source, are both included in the string as data. Thus, the example: >>> hello = r"This is a rather long string containing\n\ several lines of text just as you would do in C.\n\ print hello would print: This is a rather long string containing\n\ several lines of text just as you would do in C. Strings can be surrounded in a pair of matching triple-quotes: " " " or . End of lines do not need to be escaped when using triple-quotes, but they are included in the string. >>> print """ Usage: thingy [OPTIONS] - h Display this usage message - H hostname Hostname to connect to """ produces the following output: Usage: thingy [OPTIONS] - h Display this usage message - H hostname Hostname to connect to The interpreter prints the result of string operations in the same way as they are typed for input: inside quotes, and with quotes and other funny characters escaped by backslashes, to show the precise value. The string is enclosed

86 / 94

3BK 21314 AAAA PCZZA Ed.10

6 Introduction to Python

in double quotes if the string contains a single quote and no double quotes, else its enclosed in single quotes. Strings can be concatenated (glued together) with the + operator, and repeated with *: >>> word=Good + Morning >>> word GoodMorning >>> < + word*3 + > <GoodMorningGoodMorningGoodMorning Two string literals next to each other are automatically concatenated; the first line above could also have been written "word = Help A"; this only works with two literals, not with arbitrary string expressions: >>> str ing string >>> str.strip() + ing # This is ok string >>> str.strip() ing # This is invalid File "<stdin>", line 1, in ? str.strip() ing SyntaxError: invalid syntax Strings can be subscripted (indexed); like in C, the first character of a string has subscript (index) 0. There is no separate character type; a character is simply a string of size one. Like in Icon, substrings can be specified with the slice notation: two indices separated by a colon. Slice indices have useful defaults; an omitted first index defaults to zero, an omitted second index defaults to the size of the string being sliced. >>> word[2] # the second character o >>> word[0:4] # characters from the first to the fourth Good >>> word[:4] # the first four characters Good >>> word[4:] # everything except the first four characters Morning Unlike a C string, Python strings cannot be changed. Assigning to an indexed position in the string results in an error. However, creating a new string with the combined content is easy and efficient: >>> word[0:4] + Night GoodNight Here is a useful invariant of slice operations: s[:i] + s[i:] equals s. >>> word[:5] + word[5:] GoodMorning Degenerate slice indices are handled as follows: when an index that is too large is replaced by the string size, an upper bound smaller than the lower bound returns an empty string. >>> word[1:50] oodMorning >>> word[15:] >>> word[5:3]

3BK 21314 AAAA PCZZA Ed.10

87 / 94

6 Introduction to Python

Indices may be negative numbers, to start counting from the right. Note that -0 is really the same as 0, so it does not count from the right! For example: >>> word[-1] # the last character g >>> word[-2] # the last-but-one character g >>> word[-2:] # the last two characters ng >>> word[:-3] # everything except the last three characters GoodMorn >>> word[-0] # the first character G Out-of-range negative slice indices are truncated, but do not try this for single-element (non-slice) indices: >>> word[-100:] GoodMorning >>> word[-15] # error Traceback (most recent call last): File "<stdin>", line 1, in ? IndexError: string index out of range For non-negative indices, the length of a slice is the difference of the indices, if both are within bounds. For example, the length of word [1:3] is 2. The built-in function len() returns the length of a string: >>> len(word) 11

6.1.3 Unicode Strings


The Unicode object can be used to store and manipulate Unicode data (see http://www.unicode.org/) and integrates well with the existing string objects, providing auto-conversions where necessary. Unicode has the advantage of providing one ordinal for every character in every script used in modern and ancient texts. Previously, there were only 256 possible ordinals for script characters. Texts were typically bound to a code page which mapped the ordinals to script characters. This lead to very much confusion especially with respect to internationalization (usually written as "i18n" "i" + 18 characters + "n") of software. Unicode solves these problems by defining one code page for all scripts. Creating Unicode strings in Python is just as simple as creating normal strings: >>> uGood Morning ! uGood Morning ! The small "u" in front of the quote indicates that a Unicode string is supposed to be created. If you want to include special characters in the string, you can do so by using the Python Unicode-Escape encoding. The following example shows how: >>> uGood\u0020Morning ! uGood Morning ! The escape sequence \u0020 indicates to insert the Unicode character with the ordinal value 0x0020 (the space character) at the given position. Other characters are interpreted by using their respective ordinal values directly as Unicode ordinals. If you have literal strings in the standard Latin-1 encoding

88 / 94

3BK 21314 AAAA PCZZA Ed.10

6 Introduction to Python

that is used in many Western countries, you find it convenient that the lower 256 characters of Unicode are the same as the 256 characters of Latin-1. For experts, there is also a raw mode just like the one for normal strings. You have to prefix the opening quote with ur to have Python use the Raw-Unicode-Escape encoding. It only applies the above \uXXXX conversion if there is an uneven number of backslashes in front of the small u. >>> urGood\u0020Morning ! uGood Morning ! >>> urGood\\u0020Morning ! uGood\\\\u0020Morning ! The raw mode is most useful when you have to enter lots of backslashes, as can be necessary in regular expressions. Apart from these standard encodings, Python provides a whole set of other ways of creating Unicode strings on the basis of a known encoding. The built-in function unicode() provides access to all registered Unicode codecs (COders and DECoders). Some of the more well known encodings which these codecs can convert are Latin-1, ASCII, UTF-8, and UTF-16. The latter two are variable-length encodings that store each Unicode character in one or more bytes. The default encoding is normally set to ASCII, which passes through characters in the range 0 to 127 and rejects any other characters with an error. When a Unicode string is printed, written to a file, or converted with str(), conversion takes place using this default encoding. >>> u"abc" uabc >>> str(u"abc") abc >>> u"" u\xe4\xf6\xfc >>> str(u"") Traceback (most recent call last): File "<stdin>", line 1, in ? UnicodeEncodeError: ascii codec cant encode characters in position 0-2: ordinal not in range(128) To convert a Unicode string into an 8-bit string using a specific encoding, Unicode objects provide an encode() method that takes one argument, the name of the encoding. Lowercase names for encodings are preferred. >>> u"".encode(utf-8) \xc3\xa4\xc3\xb6\xc3\xbc If you have data in a specific encoding and want to produce a corresponding Unicode string from it, you can use the unicode() function with the encoding name as the second argument. >>> unicode(\xc3\xa4\xc3\xb6\xc3\xbc, utf-8) u\xe4\xf6\xfc

3BK 21314 AAAA PCZZA Ed.10

89 / 94

6 Introduction to Python

6.1.4 Lists
Python knows a number of compound data types, used to group together other values. The most versatile is the list, which can be written as a list of comma-separated values (items) between square brackets. List items need not all have the same type. >>> a = [spam, eggs, 100, 1234] >>>> a [spam, eggs, 100, 1234] Like string indices, list indices start at 0, and lists can be sliced, concatenated and so on: >>> a[0] spam >>> a[-2] 100 >>> a[1:-1] [eggs, 100] >>> a[:2] + [bacon, 3*3] [spam, eggs, bacon, 9] >>> 2*a[:2] + [End!] [spam, eggs, spam, eggs, End!] Unlike strings, which are immutable, it is possible to change individual elements of a list: a[2] = a[2] + 23 a [spam, eggs, 123, 1234] Assignment to slices is also possible, and this can even change the size of the list or clear it entirely: >>> # replace some items: ... a[0:2] = [1,12] >>> a [1, 12, 123, 1234] >>> # remove some items: ... a[0:2] = [] >>> a [123, 1234] >>> # insert some items: ... a[1:1] = [yes, no] >>> a [123, yes, no, 1234] >>> # insert (a copy of) itself at the beginning ... a[:0] = a >>> a [123, yes, no, 1234, 123,yes, no, 1234 ] >>> # clear the list ... a[:] = [] >>> a [] The built-in function len() also applies to lists: >>> len(a) 8 It is possible the following >>> x = >>> y = to nest lists (create lists containing other lists). Note that in example, y[2] and x: [2, 3, 4] [1, x]

90 / 94

3BK 21314 AAAA PCZZA Ed.10

6 Introduction to Python

>>> y[2] [2, 3, 4] y[2][0] 2

6.2 Knowing More About Python


6.2.1 First Steps Towards Programming
The following is an example that introduces several new features: >>> # Fibonacci series: ... # the sum of two elements defines the next ... a, b = 0, 1 >>> while b < 10: ... print b ... a, b = b, a+b ... 1 1 2 3 5 8 The first line contains a multiple assignment: the variables a and b simultaneously get the new values 0 and 1. On the last line this is used again, demonstrating that the expressions on the right-hand side are all evaluated first before any of the assignments take place. The right-hand side expressions are evaluated from the left to the right. The while loop executes as long as the condition (here: b < 10) remains true. In Python, like in C, any non-zero integer value is true; zero is false. The condition may also be a string or list value, in fact any sequence; anything with a non-zero length is true, empty sequences are false. The test used in the example is a simple comparison. The standard comparison operators are written the same as in C: < (less than), > (greater than), == (equal to), <= (less than or equal to), >= (greater than or equal to) and != (not equal to). The body of the loop is indented: indentation is Pythons way of grouping statements. Python does not provide an intelligent input line editing facility, so you have to type a tab or space(s) for each indented line. In practice you prepare more complicated input for Python with a text editor; most text editors have an auto-indent facility. When a compound statement is entered interactively, it must be followed by a blank line to indicate completion (since the parser cannot guess when you have typed the last line). Note that each line within a basic block must be indented by the same amount. The print statement writes the value of the expression(s) it is given. It differs from just writing the expression you want to write (as we did earlier in the calculator examples) in the way it handles multiple expressions and strings. Strings are printed without quotes, and a space is inserted between items, so you can format things correctly, like this: >>> i = 5*5 >>> print the value of i is, i the value of i is 25 A trailing comma avoids the newline after the output: >>> a, b = 0, 1

3BK 21314 AAAA PCZZA Ed.10

91 / 94

6 Introduction to Python

>>> while b < 100: ... print b, ... a, b = b, a+b ... 1 1 2 3 5 8 13 21 34 55 89 Note that the interpreter inserts a newline before it prints the next prompt if the last line was not completed.

6.2.2 if Statement
Besides the while statement, Python knows the usual control flow statements known from other languages, with some differnences. The most well-known statement type is the if statement. For example: >>> x = int(raw_input("Please enter an integer: ")) >>> if x < 0: ... x = 0 ... print Negative changed to zero ... elif x == 0: ... print Zero ... elif x == 1 ... print Single ... else: ... print More ... There can be zero or more elif parts, and the else part is optional. The keyword elif is short for else if, and is useful to avoid excessive indentation. An if ... elif ... elif ... sequence is a substitute for the switch or case statements found in other languages.

6.2.3 for Statement


The for statement in Python differs a bit from what you may be used to in C or Pascal. Rather than always iterating over an arithmetic progression of numbers (like in Pascal), or giving the user the ability to define both the iteration step and halting condition (as C), Pythons for statement iterates over the items of any sequence (a list or a string), in the order that they appear in the sequence. For example: >>> # Measure some strings: ... a = [cat, rose, carrot] >>> for x in a: ... print x, len(x) ... cat 3 rose 4 carrot 6 It is not safe to modify the sequence being iterated over in the loop (this can only happen for mutable sequence types, such as lists). If you need to modify the list you are iterating over (for example, to duplicate selected items) you must iterate over a copy. The slice notation makes this particularly convenient: >>> for x in a[:]: # makes a slice copy of the entire list ... if len(x)>5: a.insert(0,x) ... >>> a

92 / 94

3BK 21314 AAAA PCZZA Ed.10

6 Introduction to Python

[carrot, cat, rose, carrot]

6.2.4 The range() Function


If you do need to iterate over a sequence of numbers, the built-in function range() is useful. It generates lists containing arithmetic progressions: >>> range(5) [0, 1, 2, 3, 4] The given end point is never part of the generated list; range(5) generates a list of 5 values, the legal indices for items of a sequence of length 5. It is possible to let the range start at another number, or to specify a different increment (even negative; sometimes this is called the step): >>> range(2, 5) [2, 3, 4] >>> range(0, 5, 3) [0, 3] >>> range(-10, -100, -30) [-10, -40, -70] To iterate over the indices of a sequence, combine range() and len() as follows: >>> a = [September, October, November, December] >>> for i in range(len(a)): ... print i, a[i] ... 0 September 1 October 2 November 3 December

6.2.5 break and continue Statements and else Clauses on Loop


The break statement, as in C, breaks out of the smallest enclosing for or while loop. The continue statement, also borrowed from C, continues with the next iteration of the loop. Loop statements may have an else clause; it is executed when the loop terminates through exhaustion of the list (with for) or when the condition becomes false (with while), but not when the loop is terminated by a break statement. This is exemplified by the following loop, which searches for prime numbers: >>> for n in range(2, 10): ... for x in range(2, n): ... if n % x == 0: ... print n, equals, x, *, n/x ... break ... else: ... # loop fell through without finding a factor ... print n, is a prime number ... 2 is a prime number 3 is a prime number 4 equals 2 * 2 5 is a prime number 6 equals 2 * 3 7 is a prime number

3BK 21314 AAAA PCZZA Ed.10

93 / 94

6 Introduction to Python

8 equals 2 * 4 9 equals 3 * 3

6.2.6 pass Statement


The pass statement does nothing. It can be used when a statement is required syntactically but the program requires no action. For example: >>> while True: ... pass # Busy-wait for keyboard interrupt ...

6.2.7 More About Python


For more information about Python, consult Mark Lutzs and David Aschers Python book: http://www.amazon.com/Learning-Python-Second-Mark-Lutz/dp/0596002815 /sr=1-2/qid=1166028287/ref=sr_1_2/102-5329155-7296920?ie=UTF8&books

94 / 94

3BK 21314 AAAA PCZZA Ed.10

Potrebbero piacerti anche