Home

Athlete DSS and data analysis

image

Contents

1. B Code examples I FU T ERSONAL EPOCLEVEL2 63 PERSONAL EPOCLEVEL2 FU zj ERSONAL_EPOCLEVEL3 gt 144 lt PERSONAL_EPOCLEVEL3 gt FU T ERSONAL_EPOCLEVEL4 gt 228 lt PERSONAL_EPOCLEVEL4 gt lt MOD_RESTHR gt 0 lt MOD_RESTHR gt lt MOD_WEIGHT gt 0 lt MOD_WEIGHT gt lt LOGTYPE gt 7 lt LOGTYPE gt lt dadesPersonals gt lt IntervalsHR gt lt intervalHR gt id 1 id lt minHRinterval gt 150 lt minHRinterval gt lt maxHRinterval gt 170 lt maxHRinterval gt lt intervalHR gt lt IntervalsHR gt lt atleta gt lt dadesEntrenament gt lt voltes gt lt dadesVolta gt lt id gt 1 lt id gt lt tempsIniciVolta gt 17 41 22 lt tempsIniciVolta gt lt tempsParcialVolta gt 00 12 00 lt tempsParcialVolta gt lt lapType gt 3 lt lapType gt lt notes gt lt notes gt lt altitudVolta gt lt minima gt 49 lt minima gt lt maxima gt 29 lt maxima gt lt ascendentVolta gt lt temps gt 00 00 00 lt temps gt lt distancia gt 3 lt distancia gt lt ascendentVolta gt lt descendentVolta gt lt temps gt 00 00 00 lt temps gt lt distancia gt 12 lt distancia gt lt descendentVolta gt lt plaVolta gt 140 B 1 XML file lt temps gt 00 12 00 lt temps gt lt distancia gt 2655
2. std vector lt vector lt float gt gt VelyEne try mysqlpp Query consulta connexio gt query consulta lt lt SELECT velocitatMitjana distancia FROM infoassociada WHERE idLog idLog AND identificadorUsuari NT otel So NT mysqlpp ResUse resultat consulta use if resultat mysqlpp Row row Std vector float vect aux 2 while row resultat fetch row vect aux at 0 row velocitatMitjana vect aux at 1 row distancia VelyEne push back vect aux else throw Error return VelyEne catch const mysqlpp Exception amp error delete VelyEne throw error what 145 B Code examples B 3 R connection void RgraphSpeed Energy showSpeedvsEnergy show descriptive statistics about speed average edBx gt SetWindowTex max edBx CEditx Ge edBx gt SetWindowTex min edBx CEditx Ge edBx gt SetWindowTex CEditx edBx CEditx t floatToStri tDlgItem IDC_ t floatToStri tDlgItem IDC_ t floatToStri GetDlgItem IDO ng vecstatl EDIT2 ng vecstatl EDIT3 ng vecstatl show descriptive statistics about energy average edBx CEditx Ge edBx gt SetWindowTex max edBx CEditx Ge edBx gt SetWindowTex min edBx CEditx Ge edBx gt SetWindowTex
3. 5 4 6 Bend diagram OnBendStatistics getldentificator getLogld setUserlD idUsuari idLog getBendPunctualData IDuser IDLog bendCalculation Figure 5 12 Sequence diagram of bend view 117 5 Implementation 5 4 7 Detailed bend diagram reeTestView gestorDisc bendtViewDetail RGraphBend OnBendStatistics getidentificator getLogld setUserlD idUsuari idLod Figure 5 13 Sequence diagram of detailed bend view 118 bendCalculation endSetVector bendVector punctualData I showBend SetVectorToDisplay vectorBend 5 5 Setup creation 5 5 Setup creation Finally to complete this thesis work a setup project has been developed 10 The frame work Visual Studio 2005 allows developers to create an installer for their program This is a very useful tool that helps programmers to do a more complete work and most of all it helps them in the software distribution Setup Project is composed by five useful editors 1 File system editor it allows user to choose and organize files and folders that will be installed on a PC The paths of every component can be choose and furthermore it involves a shortcut creation to the program on the user s Desktop and on the user s Program Menu and the association with related icons 2 Registry editor useful to write keys on Target user s machine registry Keys are values that programmers want to store i
4. 113 54 3 Weekly exertion diagram Lia 114 SAA LE GAGNE Loca no es Li REDUX T X a 115 5 4 5 Detailed gradient diagram 2 ooo o ow 116 346 Bend diagtami lt scs ce xk REE EERE OEE etr ER YU 117 5 4 7 Detailed bend diagram gt ow RA RE X ERRE 118 o cu Lk Roo LE REX EYES 119 6 Conclusions 123 A Database specifics 127 B Code examples 139 PA IQ AC AAA 139 B2 De acess e ai ee eS EERE 145 a ii prat et LE re e Pen 146 C Work planning 151 D Glossary 157 Bibliography 159 XXXIX Web Sites 161 XL Chapter 1 Introduction At the present time the competitiveness at professional level in the sport world is so high that any way or instrument that could help to improve athlete s performances has been pursuing In the last few years the use of technology has become more and more frequent since people understood that its use in sport disciplines gave an improvement of precedent results Nowadays at professional level a little margin of improvement could even mean the achieving of a new world record or more simply a new victory Human nature is very competitive and every person has the tendency to improve and surpass himself and his limits day by day In order to achieve this important objec tive it is necessary to always work at full capacity For this reason all parameters that could improve the performances must be controlled It exists nowadays a large number of worldwide companies indeed that invest f
5. 4 3 Bend algorithm 1 12 6 3 1 store previous bend 1 12 6 3 2 save parameters and update data 1 12 7 else there is a RIGHT bend 1 12 7 1 if this is the continuation of the previous bend 1 12 7 1 1 save parameters and update data 1 12 7 2 if there is a different bend on the same side as the previous one 1 12 7 2 1 store previous bend 1 12 7 2 2 save parameters and update data 1 12 7 3 if there is a different bend on the other side respect to the previ ous one 1 12 7 3 1 store previous bend 1 12 7 3 2 save parameters and update data 1 13 return at the cycle start 1 87 Chapter 5 Implementation This chapter is the consequence of the objectives project guidelines and requirements explained in previous chapters The whole implemented system s architecture all com ponents and classes will be described in detail In order to exhaustively explain the im plemented code this chapter is divided into five sections each one referred to a particular aspect of the system s implementation 5 1 Use cases Use cases identify system s features and associate them with the related actors As can be seen from the picture in the next page the human actor could be only Athlete Atleta or Trainer Entrenador The other actor involved in the described operation is clearly the system Each use case describes the existing relations between actors and specify actions done by them 89 5 Implementation Gradient
6. Distance Altitude Figura 1 8 Profilo mostrato da Atleta In blu il tracciato originale in rosso quello elaborato dell algoritmo La classe implementata gradientView visualizza sia il profilo altimetrico originale del tracciato che quello ottenuto dall elaborazione dell algoritmo Numerosi parametri stati stici associati sono mostrati in forma riassuntiva suddivisi per range di pendenza pen denza massima e minima numero di segmenti appartenenti al range e loro percentuale sul totale frequenza cardiaca massima e media e per concludere velocit massima e me dia Il limite angolare utilizzato pu essere modificato dall utente in tal caso il software provvede in pochi istanti a rieseguire l algoritmo ed aggiornare le statistiche L interfac cia contiene infine un apposito bottone che consente di vedere le statistiche complete di ciascun segmento individuato dall algoritmo XXIV 1 6 Algoritmo di analisi delle curve del tracciato Partendo dalle semplici coordinate topografiche questa analisi ha l obbietivo di stabilire il numero di curve di un percorso e la loro direzione L importanza di conoscere queste informazioni risiede nel fatto che ciascun atleta ha una la propria tecnica di corsa che dipende enormemente dalla propria gamba preferita La simmetria del corpo umano non perfetta per cui la potenza degli arti inferiori di ciascun individuo non distribuita equa
7. Relays 4 x 100m relay 4 x 400 m relay 4 x 200 m relay 4 x 800 m relay etc Some events such as medley relays are rarely run except at large relay carnivals Typical medley relays include the distance medley relay DMR and 9 2 Existing project the sprint medley relay SMR A distance medley relay consists of a 1200 m leg a 400 m leg an 800 m leg and finishes with a 1600 m leg A sprint medley relay consists of a 400 m leg 2 200 m legs and then an 800 m leg e Road running conducted on open roads but often finishing on the track Common events are over 5km 10km half marathon and marathon and less commonly over 15km 20km 10 miles and 20 miles The marathon is the only common road racing distance run in major international athletics championships such as the Olympics e Race walking usually conducted on open roads Common events are 10km 20 km and 50 km 2 3 Project guidelines Atleta project is planned to achieve a large number of consumers In order to obtain this goal it must have the following features 1 One of the most important characteristic of the software is the simplicity of user s use in the sense that the user can immediately understand how the application works and most of all he can easily transfer data from the device to the database For this reason software is developed to be the most possible user friendly with an extremely intuitive interface Furthermore it must be the more
8. nomPrograma identificador 14 AE d 1 e PK I1 PK id identificadorUsuari CT pii a PK id PK11 U1 kilog PK 11 01 identificadortlsuari hora durada HRmig distancia EPOC veloce Mitjana altitud energiaConsumida id LA PE ul data ut horalnici nomLog activitat durada dstancia mitjana HR HRrepos pes sensaciaActivitat nates energiaConsumida EPOC temperatura pressioAtmosferica velocitatMitjana PKJ1 maxHR si PK FK1 12 PK FK1 12 PK FK1 1 nomPia nomPrograma Identificador PK 12 identiticadorPla 2 4 Project description U g PK id identificadarUsuan rr PREIS PKU idLeg minHR A idMarca n identdicadarUsuan maxHR 4 idLogMarca identiicadorUsuariMarca hora minHR durada HRMig maxHR minHR distancia minARitud maxAltitud distAscendent distDescendent distPla tempsAsc tempsDesc maxHR tempsPla dia velocitalMax nomPla velocitatMin Identificador velocitatMig identticadorFia energiaConsumida notes mesura temps eg maxHR 1 idLag identificador identticadorUsuan e Trenes uu Tre password anyNaixement pes fumador sexe nivellActivitat minHRrepos maxHR alcada identificadorUsuari maxHR minHR per 1 PK FK1 11 identificador maxHR identificador nomActivitat identificadorPla identificador CO identificador Lee uq Ed deese Figure 2 3 Database schema
9. some training data not the whole data set This is caused by the fact that 19 2 Existing project not all running computers store the same information For example Atleta shows parameters like heart frequency altitude speed and energy consump tion related to time or to the distance of the training route 2 4 3 External devices They represent the entry point for body parameters Each runner who cooperates in the development of this project must have a training session using a running computer and every time he she must transfer data from the device to the PC because device memory is limited and probably cannot store more than one session s data In the initial part of the thesis researches have been operated in order to understand which body parameter could be retrieved from an existing running computer From a market research it emerged that there is a large number of running computer producers In particular what has been stressed are three important companies which give good warranty about the quality of their products They are SUUNTO 3 POLAR 2 and GARMIN 1 Web pages of these companies offer detailed information about technical specifica tions and features of each model This made it possible to do a feature comparison be tween different models In the following tables what can be observed are the different technical specifications relating to all the models of the three companies taken into con sideratio
10. Do you want to install these components MySQL Server version 5 0 MySQL Net Connector Figure 5 14 Screenshot of Atleta installer e File system options using the file system editor above described the files sys tem organization has been chosen by the undersigned In particular the program folder called Atleta project contains all files and libraries used by the program Furthermore during the installation process a Desktop shortcut and a entry in the user s program menu are created 121 Chapter 6 Conclusions As to conclusions this thesis activity has added new and important capabilities to Atleta software In particular a whole statistical data analysis structure has been created It performs the linear regression of data stored into the database Through a special user interface it is possible to choose on which data the linear regression has to be performed Automatically in few instants the system provides to establish the R connection to send the information that are needed and to receive processed data They are displayed to the user as graphs together with the most important associated data Linear regression is not performed on all available biological data but only on selected data which have a certain relevance in sports and medical subjects The goal of this work has not been to perform deep and complex statistical analysis but it has been to create a efficient functioning infrastru
11. expressed in beat per minute maxHR UNSIGNED Maximum user Heart Frequency INT 3 expressed in beat per minute Alcada UNSIGNED User height cm INT 3 138 Appendix B Code examples B 1 XML file lt xml version 1 0 encoding iso 8859 1 entrenament xmlns xsi http www w3 org 2001 XMLSchema instance gt atleta lt dadesPersonals gt lt MAXVENTILATION gt 145 147430298851 lt MAXVENTILATION gt lt MAXOXYGENCONSUMPTION gt 44 2072981678076 lt MAXOXYGENCONSUMPTION gt lt MAXBREATHINGFREQUENCY gt 52 9097930253813 lt MAXBREATHINGFREQUENCY gt lt PERSONAL_YEAROFBIRTH gt 1983 lt PERSONAL_YEAROFBIRTH gt lt PERSONAL_LENGTH gt 168 lt PERSONAL lt PERSONAL_WEIGHT gt 70 lt PERSONAL lt PERSONAL_SMOKING gt 0 lt PERSONAL lt PERSONAL_GENDER gt 1 lt PERSONAL_G PERSONAL RESTINGHR 255 PERSONAL RESTINGHR PERSONAL MAXHR 199 PERSONAL PERSONAL ACTIVITYCLASS 7 Pl ACTIVITYCLASS gt PERSONAL MAXOXYGENCONSUMPTION gt 15 lt PERSONAL MAXOXYGENCONSUMPTION gt lt PERSONAL_MAXBREATHFREQUENCY gt 55 lt PERSONAL_MAXBREATHFREQUENCY gt PERSONAL LUNGVOLUME 6 PERSONAL LUNGVOL PERSONAL MAXVENTILATIONS AATION gt lt PERSONAL_EPOCLEVEL1 gt 21 lt P
12. iis the index of the HR interval n is the number of HR intervals The concept of exertion count is easy to understand with the help of the chart of the next page The chart describes relative exertion as a function of exercise heart rate The higher the heart rate the harder is the exercise It is easy to agree that 30 minutes of exercise at HR of 160 beats min is about twice as exertive as 30 minutes at HR of 140 beats min The exertion count is a simple way to express the total exertion of a single training session as a combination of the intensity and duration of exercise The exertion count values are typically from 50 400 At these magnitudes they are easy to use in simple calculations 59 4 Analysis algorithms 10 8 Relative 6 exertion 4 2 A A 0 100 120 110 160 180 200 Heart rate beats min Figure 4 4 The relative exertion of an exercise as a function of heart rate A last consideration has to be done about sport factors The definition of sport fac tors is targeted at an advanced user of the software As can be seen from the following statements several factors are involved when determining an appropriate factor for a cer tain sport The basic assumption is that each individual has his her favorite sport which is most often used The following presents a selection of the most popular sports and recommendations for their sport factors The recommended factors range within 0 8 1 3 thus being of rela
13. nipulators which generate syntactically correct SQL This is the utilized method in Atleta system 16 2 4 Project description 2 Another useful instrument is the use of a Template Query It works like the C printf function The user sets up a fixed query string with tags inside which indicate where to insert the variable parts This can be very useful in the case of multiple queries that are structurally similar because it is only necessary to set up one template query and use that in the various locations of the program 3 Athird method for building queries is to use Specialized SQL Structures SSQLS This feature presents the results as a C data structure instead of accessing the data through MySQL intermediary classes It also reduces the amount of em bedded SQL code that a program needs Unfortunately a Visual Studio 2005 bug does not allow users to utilize this method into the framework The field data in a result set are stored in a special std string like class called ColData This class has got conversion operators that let the programmer automatically convert these objects to any of the basic C data types Additionally MySQL 4 defines classes like DateTime which can be initialized from a MySQL DATETIME string These automatic conversions are protected against bad conversions and can either set a warning flag or throw an exception As for the result sets as a whole MySQL offers different ways
14. vector lt float gt descriptiveStatDistance string idLog string idU Distance average maximum and minimum values CdialogManager classes Following classes belong to this category e RgraphSpeedEnergy RgraphSpeedDistance RgraphSpeedAltitude RgraphFCSpeed RgraphFCAltitude RgraphFCDistance They implement a linear regression view using the COM DCOM object described in the paragraph 3 Each class shows a couple of different variables but their code structure and functioning is the same For this reason it is possible to concentrate the attention only on one of them for example RgraphSpeedEnergy class Its function is essentially 99 5 Implementation to receive parameters from queryManager and to perform the linear regression using R In particular it receives the vectors of Speed and Energy consumption punctual values and the vectors of the related descriptive statistics it means maximum minimum and average values Subsequently it transforms this vectors into CcomSafeArray arrays 3 CComSafeArray is an ATL wrapper for SAFEARRAYs and it is used simply to allow easy access to SAFEARRAY elements This transformation of a vector of double into a vector of VARIANT results more complex than the transformation of non vectorial variables as explained in the sample code at paragraph 3 3 In this way it has been opened a connection with the statistical software R Exchange of data variables and most of all co
15. void showTrackStatistics void 1 1 uses OnGradientStatistics void OnGradientStatsEntrenador void getGradientPunctualData uses CdlalogManager ee y RENE Rgraph void gradientViewDetail function void showTrackDetailedStatistics void I I J Figure 5 5 UML diagrams for gradient 104 5 2 Conceptual model treeTestView class It has got simple methods which retrieve from the system the athlete s name and the log identifier and pass these parameters to gradientView class gradientView class This class receives the athlete s name and the log identifier from treeTestView and it calls the gestorDisc class to obtain the log structured data Subsequently gradientView imple ments the gradient algorithm described at paragraph 4 2 who starting from the altitude track profile groups segments which have the same or the similar gradient value it ap proximates this value sequence using a line segment In this way the new obtained track profile is composed by a sequence of line segments It also shows to the user this new profile as well as the calculated segment parameters and statistics Users can obviously update the gradient angular limit and the software automatically reuses the gradient al gorithm to calculate to process and finally to show the new track profile and related statistics A list control implements a summary containing all parameters relate
16. 1 dati di numerose squadre di atletica ciascuna delle quali composta mediamente da 20 corridori Le informazioni sono rappresentate da dati personali pa rametri biologici caratteristiche di ciascun atleta e dati relativi ad ogni gara o sessione di allenamento effettuati Solamente i dati topografici dei percorsi non sono presenti nel database Questo dovuto al fatto che essi sono in numero eccessivamente elevato e di conseguenza non risulta conveniente salvarli all interno del sistema locale visto il loro utilizzo poco frequente stato deciso di reperire tali informazioni da file esterni nel caso in cui debbano essere analizzate dal programma Infine opportuno precisare che si uti lizza una base di dati MySQL 4 in grado di fornire tutte le funzionalit richieste senza alcun costo di licenza Si accede ai dati contenuti nel database mediante l utilizzo delle librerie MySQL 13 IX 1 2 2 Il software Atleta Il software Atleta e stato sviluppato usando il linguaggio di programmazione ad oggetti Visual C 1 e l ambiente di sviluppo Microsoft Visual Studio 2005 6 L applica zione implementata utilizza inoltre 1 componenti ActiveX e la libreria MFC Microsoft Foundation Class library Per comprendere il funzionamento del programma esistente necessario esaminarne le caratteristiche e Organizzazione delle informazioni i dati sono suddivisi in tre grandi categorie in base alla funzione che ricoprono all inter
17. Atleta context For this reason R capabilities and characteristics have been deeply analyzed A great part of the work related to this thesis is focused on a connection between Atleta software and R R developers created a useful tool to connect R with any custom software it is called R SERVER The goal in this chapter is to describe what R server is how it has made connections possible with others programs Moreover it aims at explaining which settings and code lines on Visual C are needed to use R server under Atleta Considering R server as a DCOM server which contains a COM Interface to R the first step is to understand the general context and the meaning of these acronyms 30 3 1 R connectivity Component Object Model COM is a platform for software components introduced by Microsoft 5 in 1993 It is used to enable inter process communication and dynamic object creation in any programming language that supports this technology The term COM is often used in software development world as an umbrella term that encom passes the OLE OLE Automation ActiveX and COM technologies The essence of COM is a language neutral way of implementing objects which can be used in different environments from the one they were created in For well authored components COM allows reuse of objects with no knowledge of their internal implementation This is due to the fact that it forces component implementers to provide well defined inter
18. For this reason the original idea has been improved not only one point has been involved in the calculation but also its two following points This improvement is useful because the algorithm does not only consider one point respect to the line segment gradient but also the future progression of the track profile In this way it is possible to avoid and to do not consider little oscillations of the profile or wrong altitude values The following picture is an example of this behavior 66 4 2 Gradient algorithm 43 8916 44 4084 44 3253 44 5422 T 44 759 Altitude 44 9759 45 1928 Figure 4 7 Possible wrong value It is necessary now to describe how the algorithm works scanning each point of the track profile It involves in its calculation four points at a time the current scanned point the previous point and the two following ones It starts calculating the fictitious gradient value of the three different line segments delimited by the mentioned points e the first is delimited by the current point and the previous one e the second is delimited by the next point of the current point and the previous one e the third is delimited by the second next point and the previous one 67 4 Analysis algorithms altitude i 2 distance Figure 4 8 Involved points in gradient algorithm IDE 1 In the picture the scanned point is marked as i the
19. L algoritmo ideato partendo dai valori puntuali della distanza e della altitudine rap presentati rispettivamente sull asse delle ascisse e su quello delle ordinate crea un profilo altimetrico modificato L algoritmo associa tra loro i segmenti che presentano una pen denza simile presentando un profilo altimetrico meno frastagliato rispetto a quello otte nuto con i dati originari Tale profilo inoltre pu essere studiato con molta pi semplicit esso mette in relazione ciascun tratto del percorso con pendenza costante con parametri quali la frequenza cardiaca la velocit ed il consumo energetico L algoritmo utilizza l interpolazione mediante segmenti per calcolare il valore della pendenza Esistono molteplici metodi per l interpolazione di punti ma si scelto questo in relazione alle seguenti considerazioni e il metodo pi semplice e non introduce rumore nel calcolo XXII e dato che non possibile conosce l esatto profilo altimetrico tra due punti impos sibile stabilire quale sia l algoritmo migliore e possibile ottenere molti livelli di precisione modificando alcuni parametri L idea su cui si basa l algoritmo quella di scandire completamente il vettore conte nente il valore dell altitudine Per ciascun elemento si esegue la seguente elaborazione un punto appartiene ad un certo segmento se la pendenza del segmento che congiunge il punto stesso ed il punto precedente non eccede una determinata soglia
20. They check if all the three next points of the point considered in a certain moment could be part of the line segment This happens com paring the average gradient of the general line segment and the three gradients of the line 66599 66 segments i e segments obtained joining the points 1 i 1 and 1 2 with the point 1 1 It is necessary that at least one of the three tests is past to consider the i point as part of the general line segment In this way all points belonging to the track are checked not simply testing their positions but also keeping the future track trend into account The detailed gradient algorithm is described by the following pseudo code 1 execute cycle from 1st element to third last element of punctualData vector 1 1 if previous point i 1 is the starting point of the track 1 1 1 calculate the gradient of the segment delimited by it 1 1 and current point 1 1 2 else segment s gradient value already exists 1 2 1 update it calculating new average segment s gradient segmentGradi ent 1 3 retrieve relative distance and relative altitude between current point 1 and pre vious point i 1 1 4 calculate gradient of the segment delimited by current point 1 and previous point 1 1 1 5 retrieve relative distance and relative altitude between next point 14 1 and pre vious point i 1 1 6 calculate gradient of the segment delimited by next point i 1 and previous poin
21. that can be the requested operation execution or an exception if some conditions are not satisfied 5 3 1 Operations Name To execute linear regression Semantics To execute a linear regression of the selected log Exceptions Error message if preconditions are not satisfied Preconditions Log must exist into the database Post conditions The linear regression has been performed Name To select the exertion view Semantics To display the exertion statistics of an athlete Exceptions Error message if preconditions are not satisfied Preconditions Athlete must exist into the database Post conditions Exertion statistics have been visualized Name To select the gradient view Semantics To display the gradient statistics of a log Exceptions Error message if preconditions are not satisfied Preconditions Log must exist into the database Post conditions Gradient statistics have been visualized 110 5 4 Sequence diagrams Name To select the bend view Semantics To display the bend statistics of a log Exceptions Error message if preconditions are not satisfied Preconditions Log must exist into the database Post conditions Bend statistics have been visualized 5 4 Sequence diagrams Sequence diagrams are a very useful instrument to model the functions of the system They represent at high level which are the operation system and which classes are in volved in Time is a fundamental factor of this kind of
22. 1 parametri biologici dell atleta i dati relativi ad ogni gara od allenamento le condizioni meteorologiche e quelle ambientali Scendendo nel dettaglio sono stati studiati ed implementati algoritmi di analisi dei dati relativamente allo sforzo fisico dell atleta al profilo altimetrico della corsa ed alle caratteristiche topografiche del percorso di gara Ci ha determinato la creazione di nu merose viste statistiche suddivise per categoria e l analisi di alcuni fattori mediante la regressione lineare Il lavoro iniziato con lo studio del sistema preesistente e passando attraverso lo studio della struttura di analisi dei dati si concluso con l implementazione TH delle nuove funzionalit Nel presente documento saranno pertanto descritti gli obiettivi le scelte progettuali e le implementazioni realizzate durante il periodo di lavoro di tesi Al termine verranno riportate le conclusioni con relative considerazioni finali 1 1 Introduzione Attualmente nel mondo dello sport la competitivit a livello professionistico talmente alta che si ricerca l aiuto di qualsiasi strumento per migliorare le prestazioni ed il rendi mento di un atleta Negli ultimi anni si fa sempre pi ricorso alla tecnologia in quanto ci si resi conto che il suo impiego nelle diverse discipline sportive ha avuto come con seguenza il miglioramento dei risultati ottenuti in precedenza Si arrivati al punto a livello professionistico che un quals
23. 2 Existing project MySQL library MySQL is a powerful C wrapper for MySQUS C API It is built around STL Stan dard Template Library principles MySQL helps the programmer to manage C data structures to generate easily repetitive SQL statements and to manual creation of C data structures to mirror the database schema MySQL 5 has developed into a very complex and powerful library with different ways to perform a task The purpose of this section is to provide an overview of the most important used components of the library The process for using MySQL is similar to that of most other database access APIs 1 to open the connection 2 to form and execute the query 3 to iterate through the result set Connection and query execution Any connection to the MySQL server is managed at least by a Connection Object The most important function of the Connection is to create Query Objects for the user which are used to execute queries The library also allows to execute queries directly through the Connection Object although the more powerful Query Object is strongly recommended to execute queries To set up the Query Object to perform query executions there are three different ways 1 standard Query Object is the recommended way of building and executing queries It is subclassed from std stringstream which means that it can be used like any other C stream to form a query The library includes also stream ma
24. about a training way included data like latitude and longitude slide climb and plan distances and times Missing data Depending on the brand and model of the used training computer some data cannot be retrieved This fact entails that Atleta software can not have at its disposal all parame ters but only a part of them In particular only the parameters that they have in common are stored into the database and can be analyzed This work is focused to add on func tionalities and capabilities to the Atleta software and to process and analyze these data To definitely complete this external device report the following figures show which are the missing data related on each brand 24 2 4 Project description XSHR XSHR T6 14 13 T1 ADVISOR Initial time Finish time Date Track profile HR data Figure 2 7 Suunto missing data As it has been previously written SUUNTO T6 heart monitor is the most complete device only if used with GPS and foot POD Models X6HR X3HR and ADVISOR instead do not produce data about calendar and training duration while simpler models like T4 T3 and TX do not provide any topography course data Initial time Finish time Date Track profile HR data Figure 2 8 Polar missing data POLAR products are in general complete about body parameters but RS100 RS200 RS200SD RS400 and RS400SD training computer do not allow at all to know informa tion about track
25. che rientrassero nella categoria corsa XI 1 3 Software statistico Una parte importante del lavoro di tesi ha riguardato la creazione della struttura atta ad eseguire l analisi statistica dei dati La base di dati MySQL infatti non fornisce strumenti sufficienti per questo scopo Dalle ricerche effettuate in questo senso emerso che la soluzione migliore quella di non implementare alcuna funzione statistica manualmente ma utilizzare software apposito gi esistente Questa soluzione la conseguenza delle seguenti considerazioni implementare ciascuna singola funzione statistica richiede un grande lavoro in termini di tempo per scriverne il codice e per comprendere a fondo la teoria matematica su cui si basa Inoltre si ha un altissima probabilit di commettere errori nell algoritmo di calcolo Utilizzando invece un software apposito sono garantiti l affidabilit il livello di precisione richiesti la velocit di esecuzione e la semplicit Sul mercato si trovano numerosi software statistici dalle caratteristiche simili come SPSS MINITAB o R Per svolgere questa parte del lavoro di tesi stato scelto di utilizzare R poich esso offre alcuni importanti vantaggi non ha costi di licenza un software open source ed in continuo sviluppo da parte della nutrita community di utenti Proprio per quest ultimo motivo R un prodotto sempre pi utilizzato da Professori e ricercatori universitari R offre inoltre gli s
26. che compongono il sistema ed il flusso di dati scambiato Training session data Stored Data analysis log data and data visualization Training session data and analyzed data Figura 1 1 Elementi del sistema Come illustra la figura il sistema composto essenzialmente da tre parti e base di dati contiene i dati relativi a tutti gli atleti e agli allenatori la grande maggioranza dei dati rappresentata delle informazioni generate automaticamente dai pulsometri Solamente una minima parte inserita manualmente dell utente VIII ulteriori dati in numero decisamente inferiore provengono dalle elaborazioni del programma sui dati originali e Software Atleta permette all utente di avere una visione completa dei suoi dati di allenamento o di gara tali dati possono essere piani di allenamento viste grafiche dei parametri fisiologici oppure dati completi sulle corse I dati sono analizzati dal software per ricavare parametri pi complessi e specifici Il software gestisce la connessione sia con il database che con i dispositivi esterni e Pulsometro origina la maggior parte dei dati presenti nel database essi sono i dati immagazzinati durante ogni gara od allenamento 1 2 1 La base di dati La base di dati composta da tabelle che contengono tutte le informazioni del sistema Il database stato progettato per contenere una grande quantit di dati Dovr imma gazzinare infatti
27. che ne contiene le informazioni Il progetto Atleta prevede due tipi di prospettive future la prima riguarda il breve periodo mentre la seconda a lungo termine Nel prossimo futuro nell arco di duo o tre anni e prevista l ultimazione del progetto generale con la messa a punto sia del simulatore che del DSS Entro questo periodo ci si propone inoltre di estendere le funzionalit del software riservate per il momento solo alla corsa a molte altre discipline dell atletica A lungo periodo invece una volta che il sistema risulti perfettamente funzionante sugli XXX atleti ne prevista l applicazione in campo medico L idea nasce dal fatto che una volta conosciuti 1 dati relativi al comportamento di un fisico sano eventuali parametri che si discostino eccessivamente da essi potrebbero essere sintomo di disfunzioni o patologie in questo caso Atleta diverrebbe un utilissimo strumento di prevenzione XXXI Summary The goal of this thesis 1s to describe my work of cooperation done at the UPC Universi tat Polit cnica de Catalunya and to intensify the knowledge about the related theoretical aspects As my work is concerned it can be described as a collaboration in the Atleta project It begun in 2005 and nowadays it is still in phase of development The goal of this project is the creation of a DSS Decision Support System for sport activities that is a software for professional use whose aim is to help an athlete to improve
28. coordinates establishes which points create a bend then it stores its side respect to the starting point and many others related data Two impor tant parameters are involved into this calculation the bend length and the minimum bend angle They can be modified by users This class shows the track profile as well as the calculated bend parameters and statistics There are also two list controls that implement summaries containing all parameters related to a bend The first summary shows data as minimum and maximum angle percentage of bends respect to the total average HR average speed average gradient left bends which belong to the interval right bends and total bends This first list is grouped by angular intervals while the second one is grouped by gradient range of values This one shows minimum and maximum gradient percent age of bends respect to the total average HR average speed average bend angle left bends right bends and total bends Furthermore bendView shows descriptive statistics about gradient and plan angles The most important implemented methods are void function It implements the bend algorithm and it allows users to see the track profile and bends data void showTrackStatistic This is a very useful method which counts the general statistics and date groped by gradient and plan angular intervals Users can understand immediately the track gradient profile only watching these statistics bendViewDetail
29. cost depending on the commercial costs are SOFTWARE USE COST Visual Studio 2005 professional edition 1200 Statistical analysis AR 0 MySQL Database 0 lae Ed ng 1 The total cost of the current project is the sum of the programmer and the licenses costs and it amounts to 17760 155 Appendix D Glossary EPOC Excess Post exercise Oxygen Consumption it is a measure for the amount of oxy gen that the body needs to recover from physical exertion It describes the accumu lating training load It is a measurably increased rate of oxygen intake following strenuous activity The extra oxygen is used in the processes that restore the body to a rest state and adapt it to the just performed exercise HR A measurement of the heart rate most commonly expressed as the number of beats per minute bpm KILOCALORIE A measure of the energy value in physical activity kilocalorie kcal 1 Calorie Cal 1000 calories cal 157 D Glossary RESTING HEART RATE H Rezsr The lowest number of heartbeats per minute bpm at complete rest H RpREST decreases as the fitness level increases A typical value for adults is 60 80 bpm but for top athletes it can be below 30 bpm RR INTERVAL It is the inter beat interval TARGET ZONE To reach the goal by defining the right intensity for each exercise Depending on the product it is possible to define the target zone b
30. each other in order to avoid overtraining and not too far from each other in or der to avoid undertraining However it is difficult to evaluate the effects of both intensity 55 4 Analysis algorithms and duration in respect of the recovery time needed Until now it has been difficult to es timate the time needed for recovery after training sessions when athletic training consists of several different types of training Performance Performance Performance Exercise Initial level Initial level Initial level Time Time Time Figure 4 1 A schematic presentation of the acute effects of an exercise bout on performance The vertical axis depicts the intensity and the horizontal axis shows the duration of an exercise As can be seen from the previous schema the immediate effect of an exercise is a decrease in the performance level After the exercise a recovery phase occurs and the performance curve slightly rises above the initial level This phenomenon is exactly the supercompensation Thus for a short and certain period of time after the exercise ses sion the performance improves to a level slightly higher than it was before that exercise session This phenomenon is the basis of all training programs The next training session should occur during the supercompensation phase Then it is possible to gradually in crease performance starting each time from a slightly higher level However if the next exercise comes too early the
31. existing relationship con sidered in forms of mathematical and statistical functions between the parameters studied and retrieved in the previous phases This work has the goal of extrapolating information from founded relations and helping trainers to understand how athletes performances can be improved It involves a deep initial statistics study joined with an excellent body parameters knowledge The whole project terminates with the DSS Decision Support System creation It is a very complex work because it in volves the use of a simulation model to predict the future athlete s performances 6 2 1 Project planning A temporary simulation model implementation will be performed then the estab lishment of the used variable hypothesis and development paradigms Models will be created and implemented The final simulation model will be ready after a deep test session Tests are divided into three parts validation is used to establish if the used simulation models are the correct ones Verification 1s used to check if was performed the right model implementation The final step is accreditation i e the certification of a person a body or an institution as having the capacity to fulfill this particular function A further difficulty is to choose which information have to be shown to the user and in which way Data analysis phase is composed by determination of work hypothesis deep statistics data study bod
32. fact that p values are based on this assumption is crucial to their correct interpretation It is a probability so its value is a fraction between 0 0 and 1 0 It has been introduced a new term the null hypothesis 6 It is a hypothesis set up to be nullified or refuted in order to support an alternate hypothesis When used the null hypothesis is presumed true until statistical evidence in the form of a hypothesis test indicates otherwise This means that the null hypothesis proposes something initially presumed true It is rejected only when it becomes evidently false That is when one has a certain degree of confidence usually 95 to 99 the data does not support the null hypothesis Formulation of the null hypothesis is a vital step in testing statistical significance Having formulated such a hypothesis the probability of observing the obtained data or data more different can be established from the prediction of the null hypothesis if the null hypothesis is true That probability is what is commonly called significance level of the results Generally one rejects the null hypothesis if the p value is smaller than or equal to the significance level In this case the null hypothesis is formulated when the method of least squares is applied Given the model in the following form yi bo Bri 3 10 50 3 5 Linear regression using R As aforesaid the aim of this method is to calculate the values of Bo and 9 that mini
33. far respect to the fixed distance threshold or if the previous one is on the opposite side there is not a new bend because this one is already part of a greater bend Therefore this algorithm establishes these different scenarios and it detects in which one the analyzed line segment is in Then it stores parameters like mean HR speed energy consumption and gradient of each bends It is important to notice that if a bend is composed by more than two line segments the algorithm provides for the average calculation of the aforesaid parameters Moreover it does an average among all the line segments involved 76 4 3 Bend algorithm The first step consists on a transformation of a line segment expressed by the Carte sian coordinates of its extreme points into a line segment expressed by polar coordinates Polar coordinates are the length s and the angle a XA yA Cartesian coordinates Polar coordinates Figure 4 15 Point s representations In order to do this it is useful to apply the Pythagorean theorem and to calculate the s line segment as the hypotenuse of a right angled triangle It is shown by the following picture TT 4 Analysis algorithms y XB yB Figure 4 16 Right angled triangle The formula is s y zB 24 yB ya 4 5 The fundamental aspect to continue in the bend calculation is to obtain the polar length of each adjacent line segments Th
34. if based solely on HR Squash 1 0 1 1 Squash is similar to badminton by nature yet a lower factor is recommended be cause the movements are shorter than in badminton Soccer 1 0 See tennis The demands of soccer depend greatly on the player s role 62 4 1 Exertion algorithm Skating 1 1 1 2 In line skating resembles cycling but the resting periods are longer step frequency is very low On the other hand there is a long static phase during each step which makes the sport rather heavy Cross country skiing classic 0 9 It is possible to reach the same HR somewhat easier in whole body work but also the total energy expenditure will be a little more on a given HR than in running Cross country skiing freestyle 1 1 1 2 Skating or freestyle skiing very much resembles skating yet the HR is lower than in the classic style mainly because of long static phases and relatively slow movements and frequency in the upper body These examples refer only to normal conditions and are not applicable to extremely long or exhaustive exercise sessions These factors are valid only together with HR data It cannot be stated that 1 hour of biking is 10 harder than 1 hour running The question should rather be put in this way Is it harder to run at HR of 150 beats min than to cycle at the same HR 4 1 2 The algorithm Using the aforesaid formula and method the exertion algorithm has been implemented Its functioning i
35. in blood lactate This in turn may not be reflected in the HR and should therefore be taken into account in the sport factors Canoeing paddling 1 2 1 3 This is a typical upper body exercise For an occasional canoeist high HRs are difficult to reach but the upper body may be rather exhausted because the work is done by a limited muscle mass Rowing 0 9 1 2 See cycling and stepping However the involvement of upper body may cause effects such as in cross country skiing 61 4 Analysis algorithms Walking 1 1 Walking is similar to biking in regards to the effort for reaching a given HR Again this is due to the mainly concentric work of muscles Also walking lacks the rapid and large limb movements which per se increase HR Swimming 1 2 1 3 For a recreational swimmer high HRs are difficult to reach giving swimming a high factor The respiratory muscles are highly stressed which is also the case with upper body and hip muscles Tennis 1 0 Tennis is a game in which rapid movements and the work of the whole body are combined with relatively long pauses This combination allows your HR to react quite precisely so that additional factors may not be needed Badminton 1 1 1 2 The abrupt nature of badminton makes your HR rise relatively easily However the energy production lies mainly on carbohydrates and anaerobic energy yield without adequate respiratory stimulus and leads into a slight underestimation of exertion
36. line segments an axes roto translation is performed to align the x axis with the line segment at issue This operation is essential to understand depending on the position of the line segments if there is a left or a right bend The algorithm provides for the cases in which bends are composed by more segments or there is not a bend if the set angular limit is not exceeded Finally the detailed implemented bend algorithm is described by the following pseudo code 1 execute cycle from 1st element to third last element 1 1 apply Pythagorean theorem to calculate polar distance between current point 1 and second point 1 1 gt this line segment is called a 1 2 apply Pythagorean theorem to calculate polar distance between second point 1 1 and third point 1 2 gt this line segment is called b 1 3 apply Pythagorean theorem to calculate polar distance between current point i and third point 1 2 gt this line segment is called c 1 4 apply Carnot s theorem to calculate the angle between first and second seg ment line gt this angle is called gamma 1 5 add a to the variable cumulativeDistance 1 6 if a belong to the first quadrant 1 6 1 set variable addToAngle to 0 85 4 Analysis algorithms 1 7 if a belong to the second quadrant 1 7 1 set variable addToAngle to 37 2 1 8 if a belong to the third quadrant 1 8 1 set variable addToAngle to 7
37. lt unitats gt lt dadesAtmosferiques gt lt pressioAire gt 0 lt pressioAire gt lt temperatura gt 0 lt temperatura gt lt dadesAtmosferiques gt lt intervalMostreig gt 00 00 02 lt intervalMostreig gt FI LT ELING gt 3 lt FEELING gt lt altitud gt lt minima gt 49 lt minima gt lt maxima gt 29 lt maxima gt lt ascendent gt lt temps gt 00 08 16 lt temps gt lt distancia gt 57 lt distancia gt lt ascendent gt lt descendent gt lt temps gt 00 09 08 lt temps gt lt distancia gt 53 lt distancia gt lt descendent gt lt pla gt lt temps gt 00 35 51 lt temps gt lt distancia gt 9200 0 lt distancia gt lt pla gt lt altitud gt lt velocitatLog gt lt minima gt 0 lt minima gt lt maxima gt 4 07380727618375 lt maxima gt mitja 3 38 mitja lt velocitatLog gt lt distancia gt 9310 lt distancia gt 142 B 1 XML file lt frequenciaCardiacaLog gt maxima 172 maxima lt minima gt 45 lt minima gt lt mitjana gt 160 lt mitjana gt lt PEAKEPOC gt 162 370833608398 lt PEAKEPOC gt lt IntervalsLog gt lt intervalLog gt lt id gt 1 lt id gt lt tempsSotaInterval gt 00 03 16 lt tempsSotaInterval gt lt tempsSobreInterval gt 00 00 08 lt tempsSobreInterval gt lt tempsInterval gt 00 42 34 lt tempsInterval gt lt intervalLog gt lt IntervalsLog gt lt frequenciaCardia
38. measure of correctness of fit of linear regression A valuable numerical measure of association between two variables is the correlation coefficient r It is a value between 1 and 1 indicating the strength of the association of the observed data for the two variables The correlation coefficient gives a measure of the reliability of the linear relationship between the x and y values A value of r 1 indicates an exact linear relationship between x and y Values of r close to 1 indicate excellent linear reliability If the correlation coefficient is relatively far away from 1 the predictions based on the linear relationship y mx b will be less reliable Some examples are present in the next page 46 3 4 Linear regression s theory Try 1 perfect directlinear relationship Try 1 perfectreverse linear relationship 120 100 40 ec 89 100 120 140 eo 80 100 120 140 120 60 40 Figure 3 9 Correlation coefficient There is another parameter that functions exactly as the correlation coefficient It is called coefficient of determination and its symbol is r In the simple linear regression it is the square of the correlation coefficient The value r is a fraction between 0 0 and 1 0 and has no units An r value of 0 0 means that knowing x does not help to predict y There is no linear relationship between x and y and the best fit line is a horizontal line going through the mean of all y values When r e
39. methods retrieve a different couple of vector for example FC and Speed de pending on the previous user s choice Furthermore it retrieves from gestorDisc average maximum and minimum values of the two parameters The most important implemented methods are void RgraphicSpeedEnergy string idLog string idUsuari It retrieves punctual values of speed and energy consumption of the selected log and the descriptive statistics like average minimum and maximum values void RgraphicSpeedAltitude string idLog string idUsuari It retrieves punctual values of speed and altitude of the selected log and the descriptive statistics 97 5 Implementation void RgraphicSpeedDistance string idLog string idUsuari Itretrieves punctual values of speed and distance of the selected log and the descriptive statistics void RgraphicFCSpeed string idLog string idUsuari It retrieves punctual values HR and speed of the selected log and the descriptive statis tics void RgraphicFCAltitude string idLog string idUsuari It retrieves punctual values HR and altitude of the selected log and the descriptive statistics void RgraphicFCDistance string idLog string idUsuari It retrieves punctual values HR and distance of the selected log and the descriptive statistics gestorDisc class It represents the lower point of the software because it is the closer to the database level Its main function is to interrogate the database To
40. more oxygen quantity 32 3 6 Biomedical motivations 3 HR DISTANCE its progress indicates if an athlete is trained enough to large distances This is a secondary factor compared to the first ones but anyway it represents an aspect that does not have to be forgotten For example if the athlete s HR significantly increases after a certain covered distance this could imply wrong training plans for long distances 4 SPEED ALTITUDE this parameter is very similar to the HR ALTITUDE one described at the point 2 This is due to the fact that maintaining a high speed on a high altitude entails a stronger HR increasing than at lower altitudes A very interesting analysis could be to compare performances at different altitudes with a significant gap and to observe the speed variations in both cases 5 SPEED ENERGY this factor relates speed and energy consumption It assumes significance only if itis associated with HR DISTANCE and GRADIENT values It is very particular because it does not give a physical parameter but a psychological one It signals if a runner feels at ease running to a certain speed or not It happens that some athlete prefers run at low speed also for very long distances others for example do not feel at ease running fast on a slope or they spend too much energy on a climb In all these cases energy consumption value changes 6 SPEED DISTANCE this data has to be associated to the HR DIS
41. of representing them e Queries that do not return data Not all SQL queries return data An exam ple is CREATE TABLE For these types of queries there is a special result type ResNSel that simply reports the state resulting from the query whether the query was successful how many rows it impacted if any etc e Queries that return data dynamic method The easiest way to retrieve data from MySQL is using a Result object which includes one or more Row objects Because these classes are std vector like containers it is easy and powerful to manage the result set as a two dimensional array For example to obtain the fifth item on the second row what has to be typed is result at 1 at 4 It 17 2 Existing project also allowed the access to row elements by field name like the following example result at 2 altitude An alternate way of accessing to the query results is through a ResUse object This class acts more like a Standard Template Library input iterator than a container programmers can analyze the retrieved result set one item at a time always going forward This system has the disadvantage that it is not possible to know how many results are in the set until the end is reached Finally this method is more efficient when there are many results Queries that return data static method Specialized SQL Structures SSQLS define C structures that match table structures in the database schema T
42. of the filled data value 6 System performs again the gradient algorithm shows the track profile and the related statistics 7 User can set up the gradient factor value as default value 8 System performs again the gradient algorithm shows the track profile and the related statistics 9 He she can select the detailed gradient view 10 It shows the detailed gradient statistics and the track profiles 11 Used can select the preferred linear regression view choosing from different buttons 12 It checks the correctness of the data to process 13 System establishes a connection with R and shows the linear regression graph the textual output and the descriptive statistics of the two parameters involved Exceptions e Step 2 the system detects an error and shows a warning message box e Step 5 the system checks if the filled value is too low or too high and asks user confirmation by showing a warning message box e Step 12 the system detects an error and shows a warning message box 92 5 1 Use cases Use case bend statistics Actors user system Summary to view the bend statistics of the selected log USER SYSTEM 1 User selects the bend statistic view 2 lt checks the correctness of the data to process 3 System performs the bend algorithm shows the track profile and the related statistics 4 User can set up the angular limit and the length limit values 5 lt checks the correctness of the fill
43. plot x y col 4 gt abline result col 2 gt summary result 48 3 5 Linear regression using R Given the data set x y R produces two kinds of output 1 Graphic output it is composed by the scatterplot of the data set and the fitting line 230 225 220 215 Figure 3 10 R graphic output 2 Textual output Call lm formula y x Residuals Min 1Q Median 3Q 0 771212 0 224621 0 006061 0 151515 Coefficients Estimate Std Error t value Intercept 21 92576 0 30338 72 271 x 0 04091 0 04122 0 992 Signif LLL ven codes 0 0 001 0 01 Residual standard error Multiple R Squared 0 08966 F statistic 0 9849 on 1 and 10 DF 49 0 4929 on 10 degrees of Adjusted R squared p value 10 12 Max 1 033333 Pr tl 6 28e 15 0 344 tE D US Es ar EL freedom 0 001374 0 3444 3 Statistical software As can be observed the textual output is composed by numerous lines each one containing statistic information and estimated parameters In particular there are two values that assume great importance to verify the correctness of the used method e Multiple R Squared already described also called coefficient of determination it represents a valuable numerical measure of association between variables e P value in statistical hypothesis testing is the probability of obtaining a result at least as extreme as a given data point under the null hypothesis The
44. present the programming code of Atleta that performs the linear regression of two variables by using R and that shows R s graphic and textual outputs 3 6 Biomedical motivations At the moment in Atleta software only few linear regressions have been performed The following lines explain the motivations and the information that can be retrieved from them 14 1 HR SPEED it represents one of the most important factors In fact the knowledge of the relation between HR and speed is very important to estimate the athletic training level of a person Observing this parameter it is possible to know if it is necessary to modify current training sessions to improve the athlete s performance or not For example to have a high speed and a relatively low HR is index of a great athletic training level This is due to the fact that it means that the athlete can run faster with a lower energy consumption HR ALTITUDE a factor that can be observed is the body altitude adaptability At high altitude about 2000 m to do physical activity is more exertive this is due to the decreasing of oxygen concentration in the air Less oxygen availability usually entails the increasing of HR and respiration rate too This is the body natural behavior to maintain a constant level of oxygen in the system for a short period Another typical body reaction usually at higher altitudes over 2000 m is the red blood cell increasing to transport
45. sotto una matrice comune ed effettuare la divisione di un log in pi parti in relazione alla sua durata Confronto di log possibile effettuare il confronto di due log ed il programma ne mostra i rispettivi valori il valore massimo minimo e medio tra i due Grafici il software prevede la visualizzazione grafica di alcuni parametri di un log in relazione al tempo ed allo spazio frequenza cardiaca altitudine velocit e consumo energetico 1 2 3 Il pulsometro Il pulsometro lo strumento usato per introdurre i parametri biologici degli atleti al l interno del sistema Ciascun atleta che coopera allo sviluppo di questo progetto deve necessariamente allenarsi indossando un pulsometro Al termine di ciascuna sessione di allenamento deve trasferire tutti i dati sul proprio PC in quanto il pulsometro general mente possiede una memoria piuttosto limitata Durante la fase iniziale della tesi sono state effettuati approfonditi studi per stabilire quali informazioni immagazzinare nella ba se di dati e quali invece scartare In particolare sondando il mercato sono stati scelti tre produttori che offrono prodotti di ottima fattura GARMIN 1 POLAR 2 e SUUNTO 3 Le pagine web dei produttori offrono informazioni dettagliate riguardo le caratteri stiche dei propri prodotti per cui stato possibile confrontarle tra loro In questa fase dello sviluppo del progetto sono stati presi in considerazione solamente i modelli
46. statistics Bend statistics Exertion statistics Linear Regression view Log management Athlete management Usuari Entrenador Atleta Figure 5 1 General use cases 90 5 1 Use cases 5 1 1 Log management Use case linear regression view Actors user system Summary to view the linear regression graph of the selected parameters USER SYSTEM 1 User selects the preferred linear regression of a particular log choosing from a list lt checks the correctness of the data to process System establishes a connection with R and shows the linear regression graph the textual output and the descriptive statistics of the two parameters involved 4 User can select the reverse view wN 5 lt checks the correctness of the data to process 6 System shows the reverse view and the same statistics described at the step nr 3 Exceptions e Step 2 the system detects an error and shows a warning message box e Step 5 the system detects an error and shows a warning message box 21 5 Implementation Use case gradient statistics Actors user system Summary to view the gradient statistics of the selected log USER STE 1 User selects the gradient statistic view 2 lt checks the correctness of the data to process 3 System performs the gradient algorithm shows the track profile and the related statistics 4 User can set up the radient factor value 5 It checks the correctness
47. t MessageBox Error creating StatConnectorSrv return first R call lConnector Init _T R DECLARATIONS of class variables and values settings VARIANT lVall lVal2 1Val3 VariantInit amp lVall VariantInit amp lVal2 VariantInit amp lVal3 V VI amp lVall VT R8 V VI amp lVal2 VT R8 V VI amp lVal3 VI R8 V R8 amp lVall 12 V R8 amp 1Val2 4 V R8 amp lVal3 0 ACTIVE X initialization lConnector SetCharacterOutputDevice lCharDev lConnector AddGraphicsDevice T Gfx m GraphDev GetGFX 41 3 Statistical software 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 R initialization variables lConnector SetSymbol uno 1Vall lConnector SetSymbol due 1Valz2 lConnector SetSymbol tre 1Val3 R computation lConnector EvaluateNoReturn T tre uno due retrieving variable from R double returnValue lConnector GetSymbol tre dblVal graph and text capture lConnector EvaluateNoReturn T plot tre 1 100 lConnector EvaluateNoReturn T cat tre resource releasing 1Connector Close 1Connector ReleaseDispatch lConnector RemoveGraphicsDevice T Gfx Figure 3 6 Example 42 3 4 Linear regression s theory A close examination of same passage is needed LINE DESCRIPTION Inclusion of the R server text Active X connector and graphic Active X 1103 connector headers Local class variable
48. there are not so many differences between products like SPSS MINITAB or R If others factors are taken into account the best software for the thesis purpose is R It is the only one that has got some particular advantages it is a free license 29 3 Statistical software and an open source software two characteristics that explain its continuous development and improvement by its user community In fact R is the most used software by professors and university researchers Moreover R provides instruments to be remotely used by any custom application Finally its simplicity of distribution and its extensive documentation make it the most appropriate choice The goal of this chapter is to describe the infrastructure that has been created to em bed R in Atleta project What has been created is the structure to perform the linear regression of biological data stored into the database This standard architecture has the great advantage that it can be easily modified to perform all analysis that R allows and to make full use of R capabilities 3 1 R connectivity As mentioned in chapter 2 one of the goals of Atleta project is to create a simulation model to predict in advance athletes performances on a particular track The starting point can be represented by performing a linear regression to predict a variable knowing another one using the statistical software R 8 Obviously linear regressions have to be strongly embedded in
49. viene eseguita la re gressione lineare tra due variabili 3 visualizzazione dei dati con il comando plot si ottiene la rappresentazione Car tesiana scatterplot delle variabili 4 retta di regressione il comando abline visualizza la retta di regressione calcolata 5 visualizzazione dei risultati utilizzando summa ry si possono vedere tutte le infor mazioni relative alla regressione lineare calcolata L esempio seguente chiarisce ulteriormente quanto descritto x 1 2 3 4 5 6 7 8 9 10 11 12 ye 24560 241 5 424 1 41 9 21 5 21 43 22 5 44 3 22 4 2423 4242 4 424 9 gt result lt lm y x gt plot x y col 4 gt abline result col 2 gt summary result 1 3 3 Motivazioni biomediche della regressione lineare Il software Atleta esegue per il momento solamente regressioni lineari tra due varia bili Tali variabili sono state selezionate in base alla rilevanza delle informazioni che forniscono sotto il profilo medico sportivo 14 XVII FREQUENZA CARDIACA VELOCIT Il fattore risultante di questa regressio ne lineare certamente quello che riveste maggiore importanza Conoscendo la relazione che intercorre tra frequenza cardiaca e velocit si pu stimare il livello di allenamento atletico di una persona Osservando questo parametro si nota se sia necessario o meno variare il carico di lavoro in allenamento per migliorare il rendimento dell atleta Per esempio un alta velocit di corsa consegui
50. vs Energy add regression line if vectorLength gt 1 1Connector EvaluateNoReturn _T abline result col 2 save into a sting vector which contains the output lConnector EvaluateNoReturn T string vector capture output summary result print this vector lConnector EvaluateNoReturn _T cat string_vector sep n close and release resources lConnector ReleaseDispatch lConnector RemoveGraphicsDevice T Gfx lConnector Close 149 Appendix C Work planning Activity planning has a great importance to obtain a good work organization For this reason it is necessary to make up a Gantt chart that summarizes into an intuitive and a schematic way the whole activity set By its observation it is very simple to understand which are the steps that have been followed to achieve the conclusion of this project work An important thing to remember is that the Gantt chart shows the follows activity and it does not have to be confused with the project design The present project has been organized as it is shown by the gantt chart C REVIEW phase is the first step of the thesis and it is composed by e review existing system a panoramic view of the entire project why and how it has been created To learn technical terms parameters and concepts about athletics is necessary to establish the athlete s performance To learn its potentiality and loo
51. 0 lt distancia gt lt plaVolta gt lt altitudVolta gt lt velocitatVolta gt lt minima gt 0 lt minima gt lt maxima gt 4 07380727618375 lt maxima gt lt mit ja gt 3 70833333333333 lt mitja gt lt velocitatVolta gt lt distancia gt 9310 lt distancia gt lt frequenciaCardiaca gt lt maxima gt 164 lt maxima gt lt minima gt 0 lt minima gt lt mitjana gt 155 lt mitjana gt lt PEAKEPOC gt 162 370833608398 lt PEAKEPOC gt lt Intervals gt lt interval gt lt id gt 1 lt id gt lt tempsSotaInterval gt 00 03 16 lt tempsSotaInterval gt lt tempsSobreInterval gt 00 00 08 lt tempsSobreInterval gt lt tempsInterval gt 00 42 34 lt tempsInterval gt lt interval gt lt Intervals gt lt frequenciaCardiaca gt lt kilocalories gt 603 732716039904 lt kilocalories gt lt dadesVolta gt lt voltes gt lt tipusExercici gt correr lt tipusExercici gt lt dataEntrenament gt lt data gt 07 03 2006 lt data gt lt tempsInici gt 17 29 22 lt tempsInici gt lt tempsFi gt 18 15 18 2 lt tempsFi gt lt dataEntrenament gt lt unitats gt lt velocitat gt min km lt velocitat gt 141 B Code examples lt altura gt m lt altura gt lt distancia gt m lt distancia gt lt temps gt hora min seg lt temps gt lt data gt dia mes any lt data gt lt pressio gt pascals lt pressio gt lt temperatura gt centigrads lt temperatura gt
52. 1 9 if a belong to the fourth quadrant 1 9 1 set variable addToAngle to 7 2 1 10 if a is parallel to the x axis 1 10 1 if a goes from left to right 1 10 1 1 set variable addToAngle to 0 1 10 2 if a goes from right to left 1 10 2 1 set variable addToAngle to 37 2 1 11 if a is parallel to the y axis 1 11 1 if a goes from up to down 1 11 1 1 set variable addToAngle to 7 1 11 2 if a goes from down to up 1 11 2 1 set variable addToAngle to 0 1 12 if gamma is under the threshold there is a bend 1 12 1 calculate a and b gradient values 1 12 2 calculate rotation axis angle to perform the axes roto translation gt this angle is called rotationAngle 1 12 3 if rotationAngle is lt 0 1 12 3 1 rotationAngle angleToAdd 7 2 rotationAngle 1 12 4 else 1 12 4 1 rotationAngle angleToAdd rotationAngle 1 12 5 calculate third point s Y coordinate respect to the new axis inclination gt this variable is called relativeThirdPointY 1 12 6 if relativeThirdPointY gt 0 there is a LEFT bend 1 12 6 1 if this is the continuation of the previous bend 1 12 6 1 1 save parameters and update data 1 12 6 2 if there is a different bend on the same side as the previous one 1 12 6 2 1 store previous bend 1 12 6 2 2 save parameters and update data 1 12 6 3 if there is a different bend on the other side respect to the previ ous one 86
53. 6 hours ACTIVITY TASK SUB TASK Previous related thesis study Athletics and related technical terms study Existing commercial products study Polar Suunto and Garmin Review existing Atleta c pabilities stud system Atleta fault and improvement study REVIEW i XML stud Software development product Microsoft Visual Studio 2005 study Atleta project code organization stud Statistical software capabilities study R requirements identify work __ specifications Statistical software work study R Statistical software work study R Exertion s parameters study and algorithm Analysis of the 72 algorithm creation creation Statistical software connectivity study R COM 30 1 2 DEVELOPMENT Program atabase connectivity study MySQL implementation classes ActiveX stud Programtests __ Software Visual Studio Setup Project study integration Setup project implementation Final Final tests ho Bl elsje s e e o e f e pis Fila bl TOTAL 154 Finally it is necessary to do a cost analysis Project costs includes two points e programmer cost calculated in terms of working hours As can be seen from the previous table the spent hours in the project are 828 Considering a medium pro grammer cost of 20 hour the total programmer cost is PROGRAMMER COST Eh HOURS TOTALE 828 16560 e Software license
54. Activitat VARCHAR 25 PK User activity name identificador VARCHAR 25 PK User identifier FK Usuari ENTRENADOR This table allows to save entrenador user information FIELD DATA TYPE NOTE DESCRIPTION identificador VARCHAR 25 PK User identifier FK Usuari 127 A Database specifics ASSOCIA LOG PLA This table allows to save association information about a log and a system plan FIELD DATA TYPE NOTE DESCRIPTION idLog VARCHAR 14 PK Log identifier of this FK Lo User nomPla VARCHAR 25 PK System plan name FK Pla associated to this lo identificadorUsuan VARCHAR 25 PK User identifier of the Log FK Log identificadorPla VARCHAR 25 PK User identifier of the FK Pla system plan INFOASSOCIADA This table allows to save sample information retrieved by the training computers registered every sample time FIELD DATA TYPE NOTE DESCRIPTION id VARCHAR 14 PK Sample identifier UNIQUE related to a particular Log hora TIME NOT NULL Sample time durada TIME Past time from the start time HRmig UNSIGNED Sample Heart Frequency INT 3 expressed in beat per minute distancia DECIMAL Sample distance from the start expressed in meter Velocitat DECIMAL Mean sample speed Mitjana express in min per Km EPOC DECIMAL Sample EPOC from the start expressed in ml K altitud DECIMAL Sample altitude expressed in meter Energia UNSIGNED Energy consumption Consumida DECIMAL expressed in Kcal idLog VARCHAR 14 PK Log identifier F
55. April 2007 http www microsoft com 6 Microsoft MSDN official web site June 2007 http msdn microsoft com 7 W3c official web site April 2007 8 9 10 11 http www w3c org R official web site July 2007 http www r project org C on line resource July 2007 http www codeguru com C on line resource September 2007 http www cplusplus com On line R COM resource July 2007 http sunsite univie ac at rcom 161 Web Sites 12 13 14 15 On line Rweb resource July 2007 http www math montana edu Rweb On line mySql documentation June 2007 http tangentsoft net mysql doc On line biomedical documentation September 2007 http www biosportmed it On line biomedical documentation September 2007 http www albanesi it Menu Corsal htm 162
56. Calculator EI QnLinearregression exertionViewWeekly RgraphExertion t nica elldentificator Loop nr 2 exertion count for each log of a particular day setUserlD idUsuari setUseriD IDus L getExertionDay IDus sportF actor Loop nr 1 get exertion count for each day of the selected period llistalntervalHRLog LogList gt at j usID descriptive gt 0 descriptiveStatFC LogList at j uslD Loop nr 3 multiply each HR interval of a single log per his hown exertion factor SetVectorToDisplay vectorExertion vectorSpeedMax dextLenghtNoZero Figure 5 9 Sequence diagram of weekly exertion 114 5 4 Sequence diagrams 5 4 4 Gradient diagram TreeTestView OgGradientStatistics getldentificator getLogld setUserlD idUsuari idLod getGradientPunctualData IDuser IDLog gradientCalculation Figure 5 10 Sequence diagram of gradient view 115 5 Implementation 5 4 5 Detailed gradient diagram reeTestView aradienview gestorDisc gradientViewDetail RGraphGradient OnGradientStatistics getidentificator getLogld setUserlD idUsuari idLog getGradientPunctualData IDuser IDLog gradientCalculation GradientSetVector gradientSegmentData punctualData showGradient Figure 5 11 Sequence diagram of detailed gradient view 116 5 4 Sequence diagrams
57. K ogExtern identificador VARCHAR 25 PK User identifier Usuari FK Usuari 128 ASSOCIA LOG PLA PLANIFICAT This table allows to save association information about a log and a system plan scheduled in a particular date FIELD DATA TYPE NOTE DESCRIPTION idLog VARCHAR 14 PK Log identifier of this FK Lo user nomPla VARCHAR 25 PK System plan name FK PlaPlanificat associated to this log with this user identificador VARCHAR 25 PK User identifier of the Usuari FK Lo Lo identificador VARCHAR 25 PK User identifier of the Pla FK PlaPlanificat system plan dia VARCHAR 8 PK System plan date FK PlaPlanificat ASSOCIA LOG PLA PROGRAMA This table allows to save association information about a log a system plan and a training plan FIELD DATA TYPE NOTE DE SCRIPTION idLog VARCHAR 14 PK Log identifier of this FK Lo user nomPla VARCHAR 25 PK System plan name FK PlaPrograma associated to this log with this user Identificador VARCHAR 25 PK User identifier of the Usuari FK Lo Lo Identificador VARCHAR 25 PK User identifier of the Pla FK PlaPrograma system plan nomPrograma VARCHAR 25 PK System training plan FK PlaPrograma name 129 A Database specifics ATLETA This table allows to save atleta user information FIELD DATA TYPE NOTE DESCRIPTION identificador VARCHAR 25 PK User identifier FK Usuari identificadorEntrenador VARCHAR 25 FK Usuari Trainer identifier of this user INTERVA
58. LHR This table allows to save an Heart Frequency interval FIELD DATA TYPE NOTE DESCRIPTION maxHR UNSIGNED PK Maximum interval Heart Frequency INT 3 expressed in beat per minute colorHR VARCHAR 10 Interval display color identificador VARCHAR 25 PK User identifier FK Usuari INTERVALHR_ATLETA_TEMPS This table allows to save the total time past in every HR interval of each athlete FIELD DATA TYPE NO DESCRIPTION identificador VARCHAR 25 PK User identifier Usuari FK Atleta maxHR UNSIGNED PK Maximum interval Heart INT 3 Frequency expressed in beat per minute minHR UNSIGNED PK Minimum interval Heart INT 3 Frequency expressed in beat er minute tempsZona TIME Past time in the related HR interval 130 LOG MANUAL This table allows to save a manual log created by the user FIELD DATA TYPE NOTE DESCRIPTION id VARCHAR 14 PK Log identifier UNIQUE identificadorUsuan VARCHAR 25 PK User log identifier LOG EXTERN This table allows to save a system log data imported from an external XML file FIELD DATA TYPE NOTE DESCRIPTION ld VARCHAR 14 PK Log identifier UNIQUE of a user Identificador VARCHAR 25 NOT User identifier Usuari NULL horaFi TIME Log end time maxHR UNSIGNED Maximum log Heart Frequency INT 3 expressed in beat per minute minHR UNSIGNED Minimum log Heart Frequency INT 3 expressed in beat per minute maxAltitud DECIMAL 12 3 Maximum log altitude expressed in meter minAltitud DECIMAL 12 3 Mini
59. POLITECNICO DI TORINO III Facolt di Ingegneria Corso di Laurea in Ingegneria Informatica Tesi di Laurea Magistrale Athlete DSS and data analysis Relatore Prof Pau FONSECA I CASAS Candidato Gianfranco ARCAI Gennaio 2008 II Sommario Il lavoro che viene presentato si pone l obiettivo di illustrare in dettaglio l attivit svol ta durante il periodo di tesi presso la UPC Universitat Polit cnica de Catalunya ed analizzare gli aspetti teorici che la supportano Il lavoro di tesi riguarda la collaborazione allo sviluppo del progetto denominato Atleta Lo scopo di tale progetto e quello di realizzare un DSS Decision Support Sy stem in ambito sportivo tale software avr la funzione di monitorare le prestazioni di un elevato numero di atleti fornendo l analisi approfondita dei dati al fine di perseguire il miglioramento del rendimento sportivo degli atleti stessi Partendo dall analisi dei pa rametri biologici il software sar inoltre in grado di simulare le prestazioni future degli atleti Il lavoro svolto stato incentrato sullo sviluppo del progetto esistente e sull aggiunta di nuove funzionalit al programma Il progetto Atleta che prese il via nel 2005 si trova nella fase di ultimazione dell intera infrastruttura del sistema grazie alla quale si potranno eseguire in futuro le simulazioni di prestazioni Per raggiungere questo obiettivo devono essere presi in considerazione numerosi fattori
60. RQUES This table allows to save a particular label data splitted from a log FIELD DATA TYPE NOTE DESCRIPTION id VARCHAR 12 PK Label identifier UNIQUE of log idLog VARCHAR 14 PK Log identifier FK ogExtem Identificador VARCHAR 25 PK User identifier Usuari FK LogExtern hora TIME NOT NULL Label start time durada TIME Label duration HRmig UNSIGNED Mean label Heart Frequency INT 3 expressed in beat per minute maxHR UNSIGNED Maximum label Heart Frequency INT 3 expressed in beat per minute minHR UNSIGNED Minimum label Heart Frequency INT 3 expressed in beat per minute distancia DECIMAL Label distance expressed in meter minAltitud DECIMAL Minimum label altitude expressed in meter maxAltitud DECIMAL Maximum label altitude expressed in meter Dist DECIMAL Label covered falling distance Descendent expressed in meter Dist DECIMAL Label covered rising distance Ascendent expressed in meter distPla DECIMAL Label covered plain distance expressed in meter tempsDesc TIME Label rising time tempsAsc TIME Label falling time tempsPla TIME Label plain time velocitatMin DECIMAL Minimum label speed express in min per Km velocitatMax DECIMAL Maximum label speed express in min per Km velocitatMig DECIMAL Mean label speed express in min per Km Energia UNSIGNED Label energy consumption Consumida DECIMAL expressed in Kcal notes TEXT Log notes 134 MESURA TEMPS LOG This table allows to save the time of a particular Hear
61. TANCE anal ysis 15 It indicates the body behavior especially on long distances It can be interesting to understand if a runner knows how to manage a long distance race rationing his her forces and energy to maintain a constant performance or not 23 Chapter 4 Analysis algorithms 4 1 Exertion algorithm In order to be effective and to cause an adaptable response a training session must in some way cause disturbance in the body s internal balance This particular phenomenon is called homeostasis Any physical exercise per se is exertive and deteriorates perfor mance but after training during the recovery phase the body is being built up The body adapts to the requirements of exercise in order to be able to perform that task again Actually the body is built up a little better than it was before a phenomenon known as supercompensation To know the supercompensation level and the right training frequency it is important to estimate how exertive are training sessions The method which has been utilized in this thesis in order to calculate exertion is the same suggested in the POLAR Precision Performance software manual 2 Another important factor to consider is the time required for recovery It foremost de pends on the intensity HR of the training session and also on the duration of this session For athletic training it is essential to schedule training sessions at correct intervals not too close to
62. a software ors ez esr REESE AS Extetpal VIDES uh uod RE ERA X Ed REE Statistical software AL ROOM ce heehee REEL RITRAE OG E Y Gk Y Rx 3 2 Embedding R in applications on MS Windows 34 1 Interface IStatConnector s es bs a dorsals 9 9 e 322 BDaatensef 22224 V4 Y x EY XX ed a 3 2 3 Error bandling sidra rre ao R connection example Lipari 34 Linear regression s theory LL LL Le Se Linares usina RARA 3 6 Biomedical motivations 2 2222 624644 x EX ex Analysis algorithms Ad Exertion algorithm ans doe doe Saw EHE Pee IRSE eee Ro 8 4 1 1 Calculating the exertion count ALI TRES ECO sioe bie one See EA 4 2 Gradient os yes e ca e cas natae wR OW HS 4 2 1 The algorithm os oo Keb KES KOS KH OR RO RR E Res PRETE AAA ERM E 3 AAA 43 1 WG BICC lore a dle A Implementation SL AEREO TT SLI Log MIE ro See ee eS XXXVII 29 30 so 35 38 40 41 43 48 52 55 55 58 63 64 73 76 85 51 2 Athlete management o os oos o RR RR RR 94 24 o RNE MAA XD ak Be OS OI OE 95 5 2 1 Linear regression classes cc os RE RE RR 95 221 A AI 100 e Gradient Class s III 104 524 Bendelse 62 464 26 4a 49 EER xxx 107 5 3 Model of behaviour 42s oro o o x coke 110 339 1 Op rations AM 110 5 4 Sequence diagrams si o t t RR mms 111 5 4 1 Linear regression diagram Llosses a sa ms sors xo as xa 112 5 4 2 Monthly exertion diagram o Lo
63. a sua durata Risulta necessario organizzare la frequenza degli allenamenti lasciando passare il tempo oppor tuno tra due allenamenti successivi non devono essere troppo ravvicinati per evitare il sovrallenamento e non devono essere troppo distanti da non risultare efficaci Performance Performance Performance Exercise Initial level Initial level Initial level Time Time Time Figura 1 4 Rappresentazione degli effetti di un allenamento sulle prestazioni Sull asse delle ascisse presente la durata e sull asse delle ordinate l intensit di un allenamento XIX Come si evince dallo schema precedente gli effetti immediati di un esercizio sono la diminuzione delle prestazioni Dopo l esercizio si entra nella fase di recupero du rante la quale la curva delle prestazioni cresce lentamente fino a raggiungere il livello iniziale La fase successiva quella della supercompensazione nella quale il livello del le prestazioni aumenta fino a superare quello iniziale Per incrementare visibilmente le prestazioni di un atleta l allenamento successivo deve sempre avvenire all interno fase di supercompensazione Il calcolo dello sforzo fisico stato ideato in modo tale da ricavare un parametro nume rico avendo come dati iniziali lo sport praticato la durata e l intensit dell allenamento _ i i Bees 0 100 i 200 300 400 E i i Exertion count i i i i 1 0 8 16 24 32 Recovery time h Figura 1 5 Relazione tra sfor
64. ace 36 3 2 Embedding R in applications on MS Windows Referring to the code above the following flowchart represents life cycle of a COM object that uses the IStatConnector interface create COM object Init COM object Init call transfer data to R perform computations transfer results to SetSymbol call Evaluate and application EvaluateNoReturn calls GetSymbol call Terminate connection close R Close call release COM object Figure 3 3 COM object life cycle 37 3 Statistical software With the implementation of IstatConnector it can be noted that all the components involved assume a different role On the one hand R Server runs R in background it means that it is invisible by the user while every objects gets its own process because they have different symbol spaces in R server R server also provides to redirect the R graphic and textual outputs On the other hand R client runs R in foreground and user can use R in parallel to many applications Furthermore every object accesses the same R process that is unique and allows one object access at a time each one only in its shared symbol space In this context textual and graphic output can be displayed in a window Finally both Coclasses implement more COM interfaces and the application can use any of them Different CLSID are used in order to distinguish between them 3 2 20 Data transfer Unique allowed data transfer forma
65. alues of slope and intercept in order to find the line that best predicts y from x The most common method for fitting a regression line is the method of least squares More precisely this method calculates the best fitting line for the observed data by minimizing the sum of the squares of the vertical deviations from each data point to the line if a point exactly lies on the fitted line then its vertical deviation is 0 Since the deviations are first squared then summed there are no cancellations between positive and negative values In order to better understand the working of this method in this page are reported the formulas that have to be used to perform a statistical treatment to the data Given a set of data x y with n data points the slope m and y intercept b can be determined using step by step the following formulas x average value 1 n Hr Li 2 y average value 1 TL Puy gt VAR x 1 n D n i 1 VAR y 1 n 0 y Lli 13 COV x y 3 2 3 3 3 4 3 5 3 6 3 Statistical software Correlation coefficient Tay D 3 7 OxTy Slope LOVE dg dde VAR r 0 28 y intercept b y Mx 3 9 Note that linear regression does not test whether the data are linear It assumes that data are linear and finds the slope and intercept that make a straight line which best fit the data For this reason it is necessary to find parameters which give a
66. angolare stabilita in base alla pendenza media del segmento a cui fa riferimento Nella realt pero alcuni percorsi presentano dei profili molto particolari si pensi ad esempio ad un tracciato di montagna dove ci sono numerosi saliscendi Per questa ragione sono stati presi in esame pi punti e di conseguenza pi segmenti nel calcolo dell algoritmo in modo tale da con siderare anche la tendenza futura del percorso in questione In questo modo possibile non considerare lievi oscillazioni del terreno o valori non corretti dei dati in origine altitude distance Figura 1 7 Punti coinvolti nell algoritmo XXIII 6199 1 L algoritmo di calcolo decide se il punto esaminato 1 appartiene ad un segmen to dopo aver effettuato tre test Come mostra la figura precedente il sistema calcola le pendenze dei segmenti S1 S 1 ed S 2 che congiungono rispettivamente i punti i 141 e 1 2 con il punto precedente a quello considerato i 1 Se almeno una delle tre pendenze cosi calcolate non eccede la pendenza media del segmento di riferi mento il punto considerato parte del segmento generale e l algoritmo procede verso i punti successivi del tracciato La figura seguente mostra un esempio del profilo che si pu ottenere Gradient 38 1228 40 0561 40 9933 41 9285 42 8537 43 7988 44 7341 45 6693 46 6045 47 5387 48 4749 6996 17 7144 98 7293 79 7442 6 7591 41 7740 22
67. as maximum and average HR and maximum and average speed too Furthermore it retrieves from ExertionCal culator other parameters that will be past to the appropriate graphic class to perform a interesting linear regression between exertion values and HR or speed This class shows the HR intervals of the athlete the related default exertion factors the sport factor and it allows the user to update them In this case the new exertion calculation will be imme diately processed and the graph will be automatically updated A list control implements 101 5 Implementation a summary containing all parameters related to a single day date exertion value maxi mum and average speed maximum and average HR Finally it is able to afford buttons to change the analyzed period and to select a previous one 30 days before The most important implemented method is void function int defVectToUse This is the core function of the class It calculates the one month before date starting from this day until today date it performs a call for day to ExeertionCalculator and it retrieves from it the day exertion value the maximum and average HR and speed values Subsequently it works on the graph view and using the NTGraphCtrl ActiveX control it shows the monthly exertion values and the related average HR exertionViewWeekly class Fundamentally this class works as exertionView class The difference between the two classes is that exerti
68. ased on heart rate speed pace or cadence VENTILATION Also called ventilation rate it is the rate at which gas enters or leaves the lungs VO2 The maximum capacity for oxygen consumption by the body during maximum ex ertion per minute Also known as aerobic power or maximal oxygen consumption V Oomax is a commonly used determinant of aerobic cardiovascular fitness The most accurate way to measure the VO2max is to perform a maximal exercise stress i test in a laboratory VO2mar is expressed in ml kg min HN 158 Bibliography 1 F Javier Ceballos Programaci n orientada a objetos con C III edition Madrid Ra ma 2003 2 Julian Templeman David Vitter La biblia de Visual Studio NET Madrid Anaya Multimedia 2002 3 Tom Archer Richard Leinecker La biblia de Visual C NET Madrid Anaya Multimedia 2003 4 Kevin Atkinson MySOL User Manual MySQL ABEducational Technology Re sources 2005 5 Kevin Atkinson MySQL4 Reference Manual MySQL ABEducational Technol ogy Resources 2005 6 Antonio Di Crescenzo Luigi Maria Ricciardi Elementi di statistica Napoli Liguori Editore 2000 159 Web Sites 1 2 3 Garmin official web site March 2007 http www garmin com Polar official web site April 2007 http www polar com Suunto official web site April 2007 http www suunto com 4 MySQL official web site May 2007 http www mysql com 5 Microsoft official web site
69. at treeTestView OnLinearRegressionSpeedvsAltitude void OnLinearregressionSpeedvsEnergy void OnLinearregressionSpeedvsDistance void OnLinearregressionFCvsSpeed void OnLinearregressionFCvsAltitude void OnLinearregressionFCvsDistance void Figure 5 2 UML diagram for linear regression treeTestView class Depending on the user s choice each menu s voice activates a different queryManager method More in detail each method retrieves from the system the athlete s name and the identifier of the select log it passes this parameters to the related method of queryMan ager class The menu that allows the user to choose the preferred linear regression is present in the next page 96 5 2 Conceptual model Qj Nou log manual Pla Nou log extern Pro Elimina log Rean lisi log Split log Visualitza plans associats a log Agrupacions de logs Exportar a XML Linear Regression b FC vs Speed Exertion statistics FC vs Altitude Gradient statistics FC vs Distance Bend statistics Speed vs Altitude Id Speed vs Energy consumption Speed vs Distance Passer Figure 5 3 Linear regression menu queryManager class This class receives two parameters from treeTestView the athlete s name and the log iden tifier subsequently it performs calls to the lower level where gestorDisc works Its func tion is to receive parameters to display that will be past to the graphic class Each of the following
70. automatic as possible to help user in the best manner 2 Another important feature consists in reaching the compatibility and standardiza tion with each device and the possibility of doing the same or almost the same data analysis of a training session independently of the device brand This is due to the fact that not all users can afford to buy the most expensive device or to buy the whole training set This is a focal point which is difficult to reach for two reasons e each model of training device returns different parameters for example high level heart monitors have more data than low level ones or some product does 10 2 4 Project description not give longitude and latitude coordinates e the data format of different brands can be different 3 The project is planned to be standard and does not use owner solutions as much as possible For this reason it uses XML format file to structure body and log information that is a standard and a free license format file Furthermore it uses a MySQL database whose license is free 4 The program must show graphic and processed information about runner perfor mances and the user can choose rapidly which data will be displayed or not Fur thermore these data must be compared with previous performances or with other runner s performances 5 System could in the future be utilized for lots of sports and different activities At the moment our concentration is focal
71. azioni che rivestono un ruolo fondamentale ed un riassunto dei dati suddivisi per categoria ed un li vello secondario pi approfondito e completo riservato agli utenti con necessit di vedere informazioni dettagliate su un determinato tema Come gi evidenziato pi volte all interno della tesi il lavoro svolto all interno del progetto Atleta ha riguardato la terminazione dell intera infrastruttura del sistema Tut tora il progetto si trova in fase di pieno sviluppo e molti sono i collaboratori che ne pren dono parte ognuno di essi occupandosi di un aspetto specifico Le tematiche in questione sono numerose e affrontano sia lo sviluppo di nuove funzionalit che il miglioramento di quelle esistenti ad esempio vi e lo scambio di dati tra 1 pulsometri professionali ed il sistema che non ancora automatico e semplice come dovrebbe essere quello di un soft ware che vuole incontrare un numero elevato di utenza Inoltre il lavoro da me svolto si occupa unicamente del funzionamento su una singola macchina Alcuni ricercatori stan no realizzando un sistema distribuito grazie al quale si potr accedere alle funzionalit del software anche attraverso il web in questo caso l architettura tradizionale del sistema verr rivoluzionata per assumere la conformazione tipica del modello client server In al tre parole quello che si vuole ottenere una scissione netta tra il software che rappresenta il motore dell applicazione ed il database
72. c and simple as should be for a software that want to achieve a large number of users Furthermore the work that has been done was focused only on the system functioning on a single computer Some researchers are creating a distributed system which will allow to access to the system functionalities by 124 web in this case the traditional architecture will be transformed following a client server model In other words there will be a marked division between the software system engine and the database Atleta project has two future perspectives the first one is a short term project while the second is a long term one In the next two or three years the completion of the general project the set up of the software simulator and the DSS are planned to reach their conclusions Within this data all the functions will be extended to many other athletics disciplines As regards the long term perspective it is expected to do a medical application once the system proves to be perfectly operable on athletes Once that data related to a healthy body are well known the idea is that all those parameters which are so different from these data could be symptoms of pathologies As a consequence Atleta could be a useful medical application 125 Appendix A Database specifics This section is dedicated to describe each table contents ACTIVITATS This table allows to save the name of user activity FIELD DATA TYPE NOTE DESCRIPTION nom
73. caLog gt lt kilocalories gt 603 732716039904 lt kilocalories gt dadesEntrenament lt dadesEntrenamentHR gt dada alcada 35 alcada lt epoc gt 0 00831607204232823 lt epoc gt lt fc gt 109 lt fc gt lt peapok gt 0 00831607204232823 lt peapok gt lt rr gt 28 lt rr gt lt ventilacio gt 46 647539620774 lt ventilacio gt lt V02 gt 15 2349521683399 lt V02 gt lt energia gt 5 18772407676901 lt energia gt lt RR gt 2 55752239436743 lt RR gt lt distancia gt 0 lt distancia gt lt velocitat gt 3 6666666666666 lt velocitat gt lt dada gt lt dadesEntrenamentHR gt lt origenDades gt lt pulsometre gt lt marca gt SUUNTO lt marca gt lt model gt T6 lt model gt 143 B Code examples fitxer CorredorCollserola sdf fitxer lt pulsometre gt lt cartografia gt lt format gt IDRISI32 lt format gt lt mdt gt lt codificacio gt raster lt codificacio gt lt fitxer gt Cursa_Collserola lt fitxer gt mdt capes codificacio vectorial codificacio lt fitxer gt Cursa_Collserola lt fitxer gt lt capes gt lt wrl gt Cursa_Collserola lt wrl gt lt cartografia gt lt origenDades gt lt entrenament gt 144 B 2 Database access B 2 Database access return vector of vector lt float gt with parameters vector vector float GestorDisc dataVectorSpeedDistance string idLog string idU
74. ched determination of data format determination of database structure and how to manage it software implementation 2 Existing project parser implementation to import and normalize data from external devices that will be stored into the database data visualization in a useful and comprehensible shape data management creation of statistical data analysis structure creation of web access structure e Data retrieval it represents a collaboration between project developers and differ ent existing athletics teams This phase is necessary to retrieve great quantities of valid data Its start is estimated on January 2008 and its duration is exactly one year The starting point is not a parameter as restrictive as the duration The duration is the most important factor of this development part of Atleta project because the aim is to obtain training data of all seasons This is due to the fact that it s important and useful compare the athlete s performance related to the same training session but done in different seasons to study if and how climatic conditions affect it Data retrieval is divided into sub activities detection of athletes teams which cooperate with the project in question detection of retrieval data procedure retrieval data phase validation data procedure possible database modification e Data analysis this final phase consists in finding the
75. cise that was felt to be difficult The average heart rate is 137 bpm and speed 4 30 min km The heart rate curves show a distinct difference in the state of recovery The situation demonstrated by the upper curve is due to heavy training during the days prior to the test It is important to state that increased heart rate level during light aerobic training may also be caused by other factors such as flu 0 00 00 0 10 00 0 20 00 0 30 00 0 40 00 0 50 00 Figure 4 3 Heart rate curves comparing recovered situation vs strained tired situation 4 1 1 Calculating the exertion count The exertion count has been developed to ease and simplify the analysis of athletic train ing programs It combines three factors of a training session into a single measurable figure 1 duration time expressed in minute 58 4 1 Exertion algorithm 2 intensity heart rate expressed in beats per minute 3 sport factor constant depending on the sport For each training intensity interval HR interval is given an exertion factor by which the time spent at that HR is multiplied Some exercise modes or sports have their addi tional impact on the exertion and thus a sport factor is applied The exertion count is the total sum of these three components Its formula is the following one TL Exertion Y EF of H R interval time spent in that interval SF 4 1 i 0 where EF is the Exertion Factor SF is the Sport Factor
76. ck line segment 14 1 store data related to last line segment It goes from starting point to the track final point 75 4 Analysis algorithms 4 3 Bend algorithm Starting from the simple topographic coordinates this algorithm has the purpose to detect when there is a bend in the track and if it is a left bend or a right one It is important to know these circumstances because each runner has his own run technique that very much depends on his preferred leg i e a leg more powerful than another The fact that each athlete has got a preferred leg could entail differences in term of speed and energy consumption and could concern a left or a right bend For this reason to cover a track in a way or in the opposite one could involve that the same athlete can obtain different performances This behaviour has been acutely taken into consideration studied and analyzed The idea of this algorithm is that a track is represented by a sequence of line segment Track data are GPS coordinates which can be displayed by using a simple Cartesian graph Depending on the amplitude of the calculated angle between each adjacent line segment the following cases can be presented e if the angle value is too high compared to a fixed threshold there is no bend The reason is that the two line segment compose nearly a straight line e if the angle is under the threshold there are different scenarios there is a bend if the previous bend is too
77. class This class receives the data to display already processed by bendView These data are on form of vectors the first contains punctual data of the track and the second one contains parameters of each bend A list control implements a summary containing all parameters related to a single bend distance from the start point altitude side angle gradient HR 108 5 2 Conceptual model speed and energy consumption Furthermore it performs linear regressions between e HR and angle HR and gradient Speed and angle Speed and gradient Angle and gradient gestorDisc class Its function is to interrogate the database It selects the selected log s data and store them in a particular structure called bend punctual data The implemented method is getBendPunctualData string usID string logID It returns logs punctual data of altitude HR energy consumption and speed CdialogManager classes The following classes belong to this category e RgraphBendHRAngle e RgraphBendHRGradient e RgraphBendSpeedAngle e RgraphBendSpeedGradient e RgraphBendAngleGradient They implement a linear regression view exactly in the same way already explained for the linear regression CdialogManager classes at 5 2 1 109 5 Implementation 5 3 Model of behaviour This model is a useful instruments to determine how the system reacts to users actions Each operation generates a system state modification
78. cquistato poich ciascuna impresa utilizza un formato di dati proprietario Questo fattore costituisce uno svantaggio non indifferente poich con lo stesso programma non possibile visualizzare dati provenienti da strumenti di marche distinte A seguito di tali considerazioni si inserisce l idea di creare uno strumento nuovo nato dall esigenza di ovviare alle carenze di quelli esistenti per superarne le limitazioni e proporsi come alternativa in particolar modo per quanto riguarda l uso professionale Il progetto Atleta si propone dunque come strumento in grado di offrire caratteristiche e funzionalit nuove nel settore dell analisi dei dati biologici Esso prese il via nel settembre del 2005 e si trova tuttora in fase di sviluppo Tale progetto di durata pluriennale ha come obiettivo quello di creare un DSS Decision Support System un software molto complesso in grado di permettere il monitoraggio costante e dettagliato delle prestazioni sportive di un elevato numero di atleti e l analisi approfondita dei dati raccolti al fine di perseguire il miglioramento del rendimento sportivo degli atleti stessi Attraverso l analisi di una grande quantit di dati il DSS si comporter come un vero e proprio sistema di si mulazione con l obiettivo di prevedere in anticipo le prestazioni future di un atleta in una particolare disciplina su uno specifico tracciato con particolari condizioni atmosferiche ed ambientali Atleta si pro
79. ct athletes could have significant difference in terms of speed or energy consumption depending on the ground slope For example an athlete could have a great resistance in a climb but not have a good running technique during slopes so his her performances can be affected by these factors Studying track profiles related on training session is useful to highlight body limits or athletic faults to perform the best training sessions to improve athletes performances Starting from the punctual values of distance and altitude represented on the x axis and y axis of a Cartesian graph respectively this algorithm has the goal to show a different track profile It associates to a single line segment more sub segments which have in common the similar gradient value This is important to obtain a less jagged track profile which can be studied and analyzed with much more simplicity From it one can see lots 64 4 2 Gradient algorithm of information about track gradient in different parts of the track like for example HR speed and energy consumption variation in relation with their own gradient values The gradient algorithm utilizes the line segment interpolation to calculate in a easy way the gradient value Obviously exist lots of algorithms to interpolate points but the undersigned uses the line segment because e itis the simplest one e it does not introduce noise in calculation e itis not possible to know the exact track profi
80. cted file in XML format 3 use Atleta to standardize XML file and import it 27 2 Existing project It is clear that all that has been just described represents a big fault of Atleta It must be improved in the future in order to achieve one of the main fixed points of this project the simplicity of use Atleta XML format The XML file has been studied and structured to contain all necessary information which will be subsequently analyzed displayed and used to show a simulation of the run way by the program The file in question contains in addition data to build other files e HTML file to visualize data e WRL file to see the simulation track The XML file see appendix B 1 shows the utilized structure to store data The XML schema is basically divided into three main labels which are e Atleta contains all personal data that describe the athlete and his her physical char acteristics some of them are for example sex age height and weight Furthermore 1t contains maximum and minimum values of HR e DadesEntrenament information about laps or parts of a single log training ses sion In fact a single log could be split into more laps It stores data like speed distance exercise type and atmospheric information e DadesEntrenamentHR this section includes the main quantity of data repre sented by sample data stored each instant the sample s number obviously depends on the chosen sampling f
81. ctivitats durada TIME Plan duration distancia UNSIGNED Plan distance expressed in DECIMAL meter notes TEXI Plan notes PROGRAMMAENTRENAMENT This table allows to save the system training programs FIELD DATA TYPE NOTE DESCRIPTION nomPrograma VARCHAR 25 PK Training program name identificador o VARCHAR 25 PK Training program identifier FR Usuari 137 A Database specifics PLAPROGRAMA This table allows to save a system plan related to a particular training plan FIELD DATA TYPE NOTE DESCRIPTION nomPla VARCHAR 25 PK Plan name Nom VARCHAR 25 PK Training program name Programa FK Programa associated to this plan Entrenament identificador VARCHAR 25 PK User identifier of the training FK Programa program associated to this plan Entrenamen activitat VARCHAR 25 NOT NULL Activity name of this plan FK Activitats durada TIME Plan duration distancia UNSIGNED Plan distance expressed in DECIMAL meter notes TEXT Plan notes USUARI This table allows to save user information FIELD DATA TYPE NOTE DESCRIPTION identificador VARCHAR 25 PK User identifier Password VARCHAR 25 User password anyNaixement YEAR User date of birth Pes UNSIGNED User weight expressed in Kg DECIMAL 3 2 Fumador BOOLEAN lt states if the user is a smoker or not Sexe BOOLEAN User Sex TRUE female FALSE male nivellActivitat UNSIGNED User activity level INT 2 minHRrepos UNSIGNED Minimum user rest Heart Frequency INT 3
82. cture which performs this analysis In this way a solid base has been build for future researchers They will cooperate to the project and they will use this useful instrument Thanks to this detailed documentation they can make full use of the great potential of the statistical software R Furthermore an important part of this work was the planning and the creation of three algorithm of data analysis They are related to athlete s exertion track s gradient and bends of the training way respectively These analysis are referred to particular tricky aspects about athletics training and their goal is to show some detailed statistics Moreover they calculate parameters which can be used as input for the DSS simulator engine It will be implemented in the next years in order 123 6 Conclusions to know in advance future athlete s performances Finally as to simplify distribution and use an installer for Microsoft operating system has been developed It installs in few steps Atleta the MySQL database and all the components that are needed by the software to its correct functioning As software component development are concerned the architectural aspect has been managed in order to follow a programming modular approach By using this method a certain extendibility has been added too In this way it is possible to add new capa bilities to the project without any change in the architecture Since it was important to follow the p
83. d to a gradient range of values minimum and maximum gradient values number of segments that belong to this range percentage respect to the total line segments of the track max imum and average speed maximum and average HR The implemented most important methods are void function It implements the gradient algorithm and it allows the user to see the track profiles void showTrackStatistic It is a very useful method which counts the number of track line segments which belong to a particular gradient range and all the related parameters already commented Users can understand immediately the track gradient profile only watching these statistics 105 5 Implementation gradientViewDetail class This class receives the data to display already processed by gradientView These data are on form of vectors the first contains punctual data of the track and the second one con tains parameters of each line segment A list control implements a summary containing all parameters related to a single line segment starting and final distance starting and fi nal altitude gradient maximum minimum and average speed maximum minimum and average HR maximum minimum and average energy consumption Furthermore it per forms interesting linear regressions between segment gradient values and HR speed and energy consumption related to each segment gestorDisc class Its function is to interrogate the database It selects the log
84. dentifier PK Log and Label identifier PK User and Label identifier PK Maximum interval Heart Frequency expressed in beat er minute PK Minimum interval Heart Frequency expressed in beat per minute Past time in the related HR interval 132 LOG This table allows to save a system log data FIELD DATA TYPE NOTE DESCRIPTION id VARCHAR 14 PK Log identifier UNIQUE Identificador VARCHAR 25 NOT NULL User identifier Usuari PK nomLog VARCHAR 25 NOT NULL Logname activitat VARCHAR 25 NOT NULL Activity name data DATE NOT NULL Log date horalnici TIME NOT NULL Log start time durada TIME NOT NULL Log duration distancia UNSIGNED NOT NULL Log distance expressed in DECIMAL meter mitjanaHR UNSIGNED NOT NULL Mean log Heart Frequency INT 3 expressed in beat per minute HRrepos UNSIGNED User rest Heart Frequency INT 3 related to this log date expressed in beat per minute pes UNSIGNED User weight related to this log DECIMAL 3 2 date expressed in Kg Sensacio UNSIGNED User sensations Activitat INT 2 Energia UNSIGNED User energy consumption Consumida DECIMAL related to this log expressed in Kcal EPOC DECIMAL User EPOC related to this log expressed in ml Kg notes TEXT Log notes temperatura DECIMAL Log temperature expressed in 2 2 C Pressio DECIMAL Atmospheric pressure Atmosferica expressed in B Velocitat DECIMAL Mean speed related to this log Mitjana 3 2 expressed in min per Km 133 A Database specifics MA
85. diagram and it is represented on the vertical axis Furthermore one can observe the method calls of each class and their temporal schedule Following diagrams show the main implemented system operations 111 5 Implementation 5 4 1 Linear regression diagram OnLineg regressionFCvsDistance getidentificator getldLog RgraphicFCDistance idLog idUsuari dataVectorF CDistancelidLog idUsuari descriptiveStalDistance idLog idUsuari descriptiveStatFC idLog idUsuari SetVectorToDisplay vc1 vc2 int vet size stat1 stat2 Figure 5 7 Sequence diagram of linear regression 112 5 4 Sequence diagrams 5 4 Monthly exertion diagram OnLinearregression E er of a particular day setUserlD idUsuari Loop nr 1 D i get exertion getExertionDay IDus aux string coefVet sportFactor count for each day of the selected period listaLogs Date uslD day llistalntervalHRLog LogList at j uslD Loop nr 3 descriptiveStatSpeed LogL ist at j uslD multiply each HR interval of a single log per his descriptiveStatFC LogList gt at j usID hown exertion factor de SetVectorToDisplay vectorExertion vectorSpeedMax dextLenghtNoZero MUR A IRE Figure 5 8 Sequence diagram of monthly exertion 113 5 Implementation 5 4 3 Weekly exertion diagram TreeTestView Exertion
86. do this gestorDisc uses mySQL li brary class and gives the retrieved data which are stored in a vector to the queryManager They could be descriptive statistics or punctual parameters values The most important implemented methods are dataVectorSpeedEnergy string idLog string idU It returns punctual values of speed and energy consumption of a log dataVectorSpeedDistance string idLog string idU It returns punctual values of speed and distance of a log dataVectorSpeedAltitude string idLog string idU It returns punctual values of speed and altitude of a log dataVectorFCSpeed string idLog string idU It returns punctual values of HR and speed of a log dataVectorFCAltitude string idLog string idU It returns punctual values of HR and altitude of a log 98 5 2 Conceptual model dataVectorFCDistance string idLog string idU It returns punctual values of HR and distance of a log About descriptive statistics these are the implemented methods vector lt float gt descriptiveStatSpeed string idLog string idU Speed average maximum and minimum values vector float descriptiveStatEnergy string idLog string idU Energy consumption average maximum and minimum values vector float descriptiveStatFC string idLog string idU HR average maximum and minimum values vector lt float gt descriptiveStatAltitude string idLog string idU Altitude average maximum and minimum values
87. e following step is to calculate the angle between them To reach this goal it is necessary to use Carnot s theorem It states the following relations between sides and angles and could be applied to any triangle a W e 2 b ccosa 4 6 b a e 2 a c cosh 4 7 78 4 3 Bend algorithm c b a 2 b a cosvy 4 8 Figure 4 17 Carnot s triangle In the case of a track considering two line segment at a time the triangle could appear in this form XB VB Figure 4 18 Bend angle Moreover once the sides of the triangle have been calculated with the 4 5 formula as shown in the picture they are the real line segments a and b and the fictitious one 79 4 Analysis algorithms c with the inversion of the formula 4 8 it is easy to find the y angle i e the bend angle 2 2 2 b a o 49 y arccos xa The next step is more complicated It has the goal to determine if the bend is on the right or on the left side In order to do this it is necessary operate a roto translation of the Cartesian axis This operation has to be done for each bend and is the way to determine the following bend s side Particularly the x axis is superimposed to the analyzed line segment and its direction is the same of the track s one The following example will better clarify this concept y I i Figu
88. e goals of Atleta project is to create a simulation model in order to predict in advance athletes performances on a particular track The starting point can be represented by performing a linear regression to predict a variable knowing another one by using the statistical software R In this section the linear regres sion s theory is explained as well all passages that have to be followed to perform a linear regression with R 43 3 Statistical software Linear regression attempts to model the relationship between two variables by fitting a linear equation to observed data One variable is considered to be an explanatory variable the other is considered to be a dependent variable A linear regression line has an equation of this form y mx b 3 1 where e xis the explanatory variable e yis the dependent variable e mis the slope of the line e bis the intercept the value of y when x 0 y mx b Figure 3 8 Linear regression line The slope quantifies the steepness of the line It equals the change in y for each unit change in x It is expressed in the units of the y axis divided by the units of the x axis If the slope is positive y increases as x increases If the slope is negative y decreases as x increases The y intercept is the y value of the line when x equals zero and it defines the elevation of the line 3 4 Linear regression s theory The goal of linear regression is to adjust the v
89. e nei tracciati in salita VELOCIT DISTANZA questo valore va associato all analisi tra frequenza car diaca e distanza 15 Esso indica il comportamento del fisico sulla lunga distanza XVII utile per capire se un atleta in grado o meno gestire e razionare le proprie risorse lungo tutto il percorso di gara in modo tale da mantenere una prestazione costante 1 4 Algoritmo di analisi dello sforzo fisico Per poter essere ritenuta efficace una sessione di allenamento deve provocare un cam biamento all interno dell equilibrio fisico di un atleta Questo particolare fenomeno detto omeostasi Ogni esercizio fisico di per s stancante ma dopo l allenamento durante la fase denominata di recupero il normale stato fisico viene ristabilito Il fisi co si adatta allo sforzo richiesto dall esercizio svolto in modo tale da poterlo affrontare nuovamente ma con prestazioni migliori questo fenomeno conosciuto con il nome di supercompensazione Per conoscere il livello di supercompensazione e la giusta frequenza degli allenamenti e determinante stabilire il livello di sforzo di una sessione di allenamento Il metodo che stato utilizzato nella tesi per calcolare lo sforzo lo stesso suggerito nel manuale di utilizzo del software POLAR Precision Performance 2 Un altro importante fattore da considerare il tempo di riposo necessario Esso dipen de sia dall intensita dell allenamento frequenza cardiaca che dall
90. e project described in the previous paragraph it is necessary to examine the present situation in order to proceed to the accurate description of the thesis work Currently Atleta project is close to the end of the first planned phase see project planning paragraph It means that this work and the one of others students involved in the project development is focused on the creation of the whole program infrastructure To carry out the infrastructure is a crucial step for software development It is considered one of most important milestones because all the future developments have as base the work done in this primary phase At the moment the mentioned DSS takes only one sport into account one is speak ing about running which behaves to the category of athletics In particular software is planned to manage running in all its different forms e track events running events conducted on a 400 m track sprints events up to and including 400 m Common events are 60 m indoors only 100m 200m and 400m Middle distance events from 800m to 3000 m 800m 1500m mile and 3000m Belongs to this category the steeplechase a race usually 3000 m in which runners must negotiate barriers and water jumps Long distance runs over 5000 m Common events are 5000 m and 10000 m Less common are 1 6 12 24 hour races Hurdling 110 m high hurdles 100 m for women and 400 m intermediate hurdles 300 m in some high schools
91. e which permits to use in a simple way the new Atleta s functionalities has been implemented Moreover all characteristics features planning decisions classes architecture use case diagrams and sequence diagrams are present too Finally chapter 6 contains the conclusions about the work that has been done it describes the current project s situation and explains its future development Chapter 2 Existing project 2 1 Project planning Atleta is certainly a very ambitious project that requires a big work in terms of time and human resources For this reason it has been planned and organized in such a manner to be developed by numerous students everyone with a different assigned work depending on the type and the level of their previous university careers Due to its complexity the project development is organized as a multi year activity and it is possible to identify three basic phases Each one is divided into several sub activities e infrastructure creation it consists in software planning requirement decision setting up its characteristics and its functional working planning which functions have to be implemented and finally deciding which kind of data utilize This rep resents the base for the following development phases For this reason this infras tructure creation is divided into the following activities determination of software requirements and its functions determination of data type to be resear
92. ed data values 6 System performs again the bend algorithm shows the track profile and the related statistics 7 User can set up the angular limit and the length limit values as default values 8 System performs again the bend algonthm shows the track profile and the related statistics 9 He she can select the detailed bend statistics view 10 It shows the detailed bend statistics and the track profile 11 Used can select the preferred linear regression view choosing from different buttons 12 It checks the correctness of the data to process 13 System establishes a connection with R and shows the linear regression graph the textual output and the descriptive statistics of the two parameters involved Exceptions e Step 2 the system detects an error and shows a warning message box e Step 5 the system checks if the filled values are too low or too high and asks user confirmation by showing a warning message box e Step 12 the system detects an error and shows a warning message box 93 5 Implementation 5 1 2 Athlete management Use case exertion statistics Actors user system Summary to view the exertion statistics of the selected athlete USER 1 User selects the exertion statistic view 3 User can set up the exertion coefficients values 6 User can set up the exertion coefficients as default values 8 User can set up the sport factor value 11 User can set up the sport facto
93. ed to deep analysis but in the majority of cases they are displayed as graph or table view This means that these software do not provide more information than the ones that training computers provide in real time during a training session Data are just visualized in a more comprehensible form Moreover the customer must utilize the furnished software because each company has its own format data This last point represents a considerable disadvantage because it is not possible to analyze data from products of different brands As consequence of these considerations what has been occurred to mind was the idea of creating a new product who can compensate lacks of existing ones It overcomes their limitations and represents a new alternative especially for professional use Atleta project is an instrument who can offer new capabilities in biological data analysis It was born in September 2005 and it is still now in phase of development This is a long term project its aim is to create a DSS Decision Support System a very complex software capable of doing a constant and detailed monitoring of the sporting performance of numerous athletes Furthermore it is able to perform deep data analysis to reach the athletes increasing performances Through the analysis of a great quantity of data the DSS is a real simulation system and its aim is to predict in advance with particular atmospheric and environmental conditions future athlete s results on a c
94. ertain sport discipline on a given track route The product s lacks present on the market are transformed into the strong point of this project By using their training devices Atleta software is planned to be a standard 2 instrument able to obtain data from any device independently from its brand or model Retrieved data are translated and mapped on a XML format file see paragraph 2 4 3 and subsequently stored into a MySQL database On the one hand data are shown to the user as graph or table view in order to highlight the most significant ones On the other hand they are subjected to more complex elaboration and processes which calculate numerous biological parameters These estimated parameters represent the DSS input variables and they assume an important role into the athlete s performance simulation The goal of the present thesis is to describe my cooperation work and my assumed role into the Atleta project development A large number of complex work phases are needed to complete Atleta project They are described in the paragraph 2 1 Project planning and are planned in such a manner that can be developed by several people at the same time A preparatory phase of the work was focused on the study of the existing project s architecture functioning and on the project development The amount of work that has to be done is very high and is so complex that students and researchers with others university careers are involved
95. escritte nel paragrafo 2 1 Project planning e sono state pianificate in maniera tale da poter essere svolte da pi studenti contemporaneamente Una fase propedeutica del lavoro di tesi stata dedicata allo studio dell architettura del funzionamento e della direzione degli sviluppi relativi al il progetto esistente Lo spettro delle attivit da svol gere piuttosto complesso tanto da coinvolgere studenti con formazioni universitarie e competenze diverse dall ingegneria L attivit svolta si colloca nella fase di ultimazione dell infrastruttura del sistema esistente illustrato in ogni sua parte nel capitolo 2 Nello svolgimento del lavoro sono state affrontate due principali tematiche la prima consiste VI nella creazione della struttura atta ad effettuare l analisi statistica dei dati mediante l in terfacciamento con il software R previa una fase di studio del funzionamento e delle po tenzialit del software R l attenzione stata rivolta all implementazione della regressione lineare analisi statistica che offre interessanti informazioni sullo stato fisico dell atleta Tuttavia lo scopo principale di questo lavoro stato quello di documentare la creazione della struttura descrivere i procedimenti ed i meccanismi del collegamento tra Atleta ed il software statistico affinch ricercatori futuri in possesso di buone competenze di medicina sportiva possano utilizzarla per analisi mirate pi efficienti e pi complesse Il la
96. f what has been said before main features of the package R DCOM SERVER are the followings Use thanks to the COM and DCOM technologies it is possible to set R for local and remote use respectively DCOM allows transparent use of remote components and application does not have to be changed for remote use By paying attention to the configuration settings on COM client s and on COM server s computer it is possi ble to obtain user synchronization To synchronize means that a given component lives in a space that could be called apartment comparable to tread context and execution context of a method call is always the component s apartment Into this apartment all method calls are synchronized but it is not allowed to have parallel lt is required that R statistical software is installed on the computer 33 3 Statistical software computations on a single R instance In particular this thesis work is focused only on local use Data transfer both from R to the client application and vice versa currently supporting scalars like booleans integers doubles and strings arrays of these and arrays of mixed data types for example booleans and strings in a single array Only one array at a time can be past because the use of array of arrays is forbidden Text and graphics output they are captured by using special ActiveX controls They allow to store outputs into particular data structures and subsequently imp
97. faces that are separate from the implementation The different allocation semantics of languages are accommodated by making objects responsible for their own creation and destruction through reference counting The preferred method of inheritance within COM is the cre ation of sub objects to which method calls are delegated Distributed Component Object Model DCOM is also a Microsoft proprietary technology for software components distributed across several networked computers to communicate with each other DCOM extends Microsoft s COM and provides the com munication substrate under Microsoft s COM application server infrastructure DCOM had to solve the problems of 1 Marshalling serializing and deserializing the arguments and return values of method calls over the wire 2 Distributed garbage collection ensuring that references held by clients of inter faces are released when for example the client process has crashed or the network connection was lost 3l 3 Statistical software 3 2 Embedding R in applications on MS Windows As mentioned before COM DCOM objects define a standard for interoperability and their function is assumed to be comparable with the one of a library This kind of programming technique similar to the object oriented paradigm is more specifically called component oriented A component is fundamentally a basic unit that can encapsulate operations methods data properties and state i
98. ficador VARCHAR 25 PK User identifier of the system Pla FK PlaPlanificat lan tempsZona TIME IntervalHR duration MESURA TEMPS PLA PROGRAMA This table allows to save the time of a particular Heart Frequency interval related to a particular system plan which behave to a particular training plan FIELD DATA TYPE NOTE DESCRIPTION maxHR UNSIGNED PK Maximum intervalHR Heart INT 3 FK Frequency expressed in IntervalHR beat per minute nomPrograma VARCHAR 25 PK System training plan name FK PlaPrograma nomPla VARCHAR 25 PK System plan name FK associated to the training laPrograma lan identificador VARCHAR 25 PK User IntervalHR identifier FK IntervalHR Identificador VARCHAR 25 PK User identifier of the system Pla FK plan PlaPlanificat tempsZona TIME IntervalHR duration 136 PLA This table allows to save a system plan FIELD DATA TYPE NOTE DESCRIPTION nomPla VARCHAR 25 PK Plan name identificador VARCHAR 25 PK User plan identifier FK Usuari activitat VARCHAR 25 NOT NULL Activity name FK Activitats durada TIME Plan duration distancia UNSIGNED Plan distance expressed in DECIMAL meter notes TEXT Plan notes PLAPLANIFICAT This table allows to save a system plan related to a particular calendar date FIELD DATA TYPE NOTE DESCRIPTION nomPla VARCHAR 25 PK Plan name identificador VARCHAR 25 PK User plan identifier FR Usuari dia DATE PR Plan date activitat VARCHAR 25 NOT NULL Activity name FR A
99. frastruttura semplice ed efficace af finch tali analisi possano aver luogo E stata in questo modo ideata la base sulla quale si fonda il lavoro di altri ricercatori che collaboreranno al progetto i quali disporranno di uno strumento funzionante e potranno sfruttare la dettagliata documentazione al riguardo per utilizzare al meglio le grandi potenzialit che offre il software statistico R Inoltre gran parte del lavoro di tesi stato quello di ideare e realizzare tre algoritmi di analisi di dati relativamente allo sforzo fisico dell atleta al profilo altimetrico del percor so di gara ed alla planimetria della corsa Tali analisi si occupano di particolari e delicati aspetti della preparazione atletica ed hanno lo scopo di visualizzarne approfondite e det tagliate statistiche rivestono inoltre un ulteriore funzione quella di calcolare determinati parametri che potranno essere utilizzati come input per il DSS che verr implementato nei prossimi anni utile per prevedere le prestazioni di un atleta in una competizione non ancora avvenuta Infine per facilitarne la diffusione e l utilizzo seppur per il momento solamente in ambito accademico stato realizzato un comodo installatore per i siste mi operativi Microsoft Esso installa in pochi passaggi il software Atleta il database MySQL e tutti i componenti aggiuntivi necessari per il coretto funzionamento Per quanto riguarda invece la realizzazione dei componenti software si cerca
100. ftware distribution In this way professors and students can run Atleta and observe the actual development state and test new introduced features The setup program is useful to perform a fast installation of Atleta and all additional components that are needed More in detail Atleta Setup Project main characteristics are e prerequisites check installation is allowed only if prerequisites are present The most important is the NET framework version 3 0 If the installer does not find it a warning message is displayed and the user can choose if download and install the missing component If the user accept an automatic download starts and solves the problem Otherwise the installation is blocked and cancelled The prerequisites check has been performed as a launch condition which checks if a key related to the NET framework is present into the local PC registry e Setup specifications the user interface editor has been utilized to create dialog boxes in which users can choose installation s details In particular they ask for ad ditional components that are needed to the correct functioning of Atleta User can select his her favorite options about installation folder too Additional components required are R R Server MySQL Server MySQL Net Connector Cortona Viewer 120 5 5 Setup creation To install these components custom actions have been created JE Atleta MySQL INSTALLATION
101. he filled value is too low or too high and asks user confirmation by showing a warning message box e Step 18 the system detects an error and shows a warning message box e Step 21 the system shows the weekly view panel which has the same statistics and contents of the monthly view panel the only difference is that the time division is week based 5 2 Conceptual model Conceptual model shows implemented classes and relations between them In this para graph four UML diagrams are presents each one is related to a particular area of interest linear regression exertion algorithm gradient algorithm or bend algorithm 5 2 1 Linear regression classes The involved classes to perform a linear regression are e treeTestView e queryManager e gestorDisc e CdialogManager classes 95 5 Implementation queryManager RgraphicSpeedEnergy void RaraphicSpeedAltitude void dataVectorSpeedEnergy float USES dataVectorSpeedDistance float RgraphicSpeedDistance void dataVectorSpeedAltitude float RgraphicFCSpeed void dataVectorF CSpeed float RgraphicFCAltitude void 777753 dataVectorFCAltitude float f b RgraphicFCDistance void dataVectorFCDistance float 1 1 descriptiveStatSpeed float i descriptiveStatEnergy float uses descriptiveStatFC float descriptiveStatAltitude float descriptiveStatDistance flo
102. his her performances By starting from deep analysis of body parameters the software will be able to simulate the future performances of the athlete This thesis work is focused on the improvement of the existing project adding on new functionalities and capabilities In this phase of project development the attention is focused on creating the main infras tructure that could allow performance simulation in the future Numerous data have to be taken into consideration some of them are body parameters training or race courses and whether conditions In particular data which have been studied and implemented are data analysis about body exertion altimetric track profile and topographic track profile This analysis has involved the creation of many statistical views grouped into thematic areas and statistical analysis of some important factors using linear regression The work had started from the knowledge of the existing project and through the technical analysis of the infrastructure creation it finished with the implementation of new software function alities In the present document objectives planning methods and development phases which have been developed during the thesis period are described in detail Finally a final evaluation about the work done as well as the conclusions and the considerations about the future of the project are present in this thesis XXXIII Acknowledgements This research activity would not have been p
103. his is called static method because table structure is fixed at compile time If some schema changes update by programmer are required to update its SSQLS defini tions and recompile In addition the program could crash or throw bad conver sion exceptions when MySQL tries to stuff the new data into an outdated data structure The advantage of this method is that the program will require very little embedded SQL code By simply executing a query results are received as C data structures 2 4 2 Atleta software Atleta software has been developed by using the object oriented programming language Visual C 1 and the Microsoft Visual Studio 2005 framework 6 The implemented application utilizes ActiveX components and the MFC Microsoft Foundation Class li brary Its programming style follows the guidelines which were expressed in the previous paragraph To understand the general software functioning it is necessary to examine the follow ing information e data organization data are divided into three main categories depending on their function They could be 18 2 4 Project description log data from training computers Each log is referred to a single training session or to a single race The whole original data set is visualized and each parameter has its own unit of measurement Plan it corresponds to a training model which can be organized created or edited Trai
104. ifferent bends on the same side e Different bends on the same side that compose a single bend the algorithm anal yses the points and detects that there is only a bend composed by more than two line segments This is due to the fact that they are on the same side and the dis tance between them is too small compared with the fixed distance threshold In this particular case all parameters estimated like angle altitude distance HR speed energy consumption and gradient will be calculated as the mean value of all param eters of each line segment involved in the calculation 83 4 Analysis algorithms Figure 4 23 Composed bend Furthermore it is important to state that in the gradient calculation as well as exposed in the previous paragraph Gradient algorithm 4 2 the distance between two points has been intended as horizontal distance and not as inclined one The gradient is so expressed by the o angle of a right angled triangle as here shown altitude distance Figure 4 24 Gradient 84 4 3 Bend algorithm Using the trigonometry laws the formula for o angle 1s the following 5 tit 1 a arctan 5 IHE 20 4 12 distance T 4 3 1 The algorithm As a summary of what has been said until now the algorithm works in the following way initially Polar coordinates are calculated to transform points represented by Cartesian coordinates into more useful line segments For each couple of adjacent
105. ime Distance Latitude Longitude Duration Pressure Temperature Lap time PS OK OK OOK OK X X X X X xXx X x Xxx A DD X X X X X X X Xx Xx X x xXx gt lt gt lt OK MM OOK X X X XX OK KK KK KOK gt lt gt lt OK X X X X X OK X x Xx A X XX X X X X X XX X X X X XX Xxx x Figure 2 6 Garmin products By examining the above tables it can be noted that the most complete configuration which gives the major number of parameters is composed by e heart monitor SUUNTO T6 e SUUNTO foot POD SUUNTO GPS POD e management software SUUNTO training manager 23 2 Existing project This equipment provides the user to receive data like heart frequency maximum minimum and average speed maximum minimum and average times plan climb slide and lap meteorological data pressure and temperature geographic data altitude and thanks to the included software it permits to calculate estimate other useful body parameters including ventilation oxygen consumption respiratory rate training effect and EPOC see glossary In general POLAR and SUUNTO instruments have similar and comparable features apart from the data analysis software the SUUNTO s one is more complex and elaborated and for this reason it allows to perform a deeper and more useful data analysis GARMIN products are a little different compared to the previous ones These are more topography oriented and return high precision data
106. into the project My work s contribution is located in the phase of completion of the existing system s infrastructure which is described in detail in chapter 2 Two main aspects have been taken into consideration the first is the creation of the statistical data analysis structure by the implementation of a connection with the R software the previous step was the study of R s capabilities then the attention has been paid on the implementation of the linear regression a particular statistical analysis which provides interesting information about the physical state of an athlete Nevertheless the main aim of this work has been the detailed structure documentation the description of every connectivity s mechanism between R and Atleta In this way future researchers specialized into sports medicine will utilize it to do more complex efficient and useful data analysis Chapter 3 explains what previously has been said The second aspect taken into consideration is the creation of three analysis algorithms related to athlete s exertion track s gradient and bends of the training way respectively Their goals are to show statis tics and to count parameters which can be used as input for the simulator engine Their theoretical aspects and functioning are described in detail in chapter 4 Chapter 5 of the 3 1 Introduction thesis explains algorithms implementation on Visual Studio 2005 framework Moreover a special user friendly interfac
107. ismatch reserved for future use SCN E INTERFACENOTFOUND 0x8004012 reserved for future use SCN E LIBRARYNOTF OUND 0x8004013 eed coukl not be SCN E INVALIDLIBRARY 0x8004014 invalid rproxy dll SCN E INITIALIZATIONFAILED 0x8004015 initialization failed SCN E INVALIDCONNE CTORNAME 0x8004016 IL name R SCN E INVALIDINTERPRETERSTATE 0x8004016 reserved for future use SCN E FATALBACKEND 0x8004020 2 cess violation in R sila interpreter package code SCN E INVALIDARG 0x8004001 reserved for future use SCN E INVALIDFORMAT 0x8004002 reserved for future use SCN E NOTIMPL 0x8004003 reserved for future use SCN E UNKNOWN 0x8004004 reserved for future use Figure 3 5 Error handling 40 3 3 R connection example 3 3 R connection example The following lines represent a sample C code that helps to immediately understand what has been described until now NOW OAHU sb db include statconnectorsrv h include statconnectorcharacterdevice h include statconnectorgraphicsdevicectl h class exampleClass DECLARATIONS of IStatConnector textual and graphic devices IStatConnector lConnector IDispatch 1CharDev NULL IDispatch 1GfxDev NULL devices connection controls if FAILED m_CharDev GetControlUnknown gt QueryInterface IID IDispatch LPVOID amp lCharDev MessageBox Error querying Dispatch from Character Device return if FAILED l1Connector CreateDispatch T StatConnectorSrv StatConnector
108. ivoglia margine di miglioramento per quanto picco lo possa essere possa tramutarsi nel superamento dell attuale record mondiale oppure pi semplicemente in una vittoria L uomo per sua natura molto competitivo e tende a migliorarsi ed a superare se stesso ed i propri limiti giorno dopo giorno Per raggiungere questo obiettivo obbligato a tenere sempre sotto osservazione quei parametri che lo portano a incrementare le proprie prestazioni in modo da poter lavorare sempre con la massima efficienza Per questo motivo esiste oggi un gran numero di aziende spesso multinazionali che gi da anni puntano molto su progetti di questo tipo Lo spettro delle possibili attivit amp piuttosto ampio e variegato alcuni produttori si occupano della strumentazione professionale in grado di rilevare i parametri biologici dell atleta certe aziende offrono servizi di analisi dei dati raccolti come supporto alle decisioni in merito allo stato fisico di un soggetto altre aziende ancora si preoccupano di produrre l abbigliamento sportivo pi adatto alla disciplina praticata Oltre a ci si assistito alla istituzione di numerosi centri sportivi specializzati in questo campo di norma al servizio di societ sportive di grande rilievo nei quali viene impiegata tecnologia all avanguardia e personale altamente qualificato per perseguire lo scopo del miglioramento delle prestazioni sportive degli atleti All interno di questo complesso scenario nato
109. ized only on running subject Once running project will be terminated the project will be developed toward different sports 2 4 Project description This system is complex and is basically composed by three different parts e Database it stores data of all the athletes and trainers most quantity of data are originated by running computers and only a little quantity are inserted manually Other stored data are generated by software processing e Software Atleta it permits to the user to have a complete view of its training data they involve training plans graphic and table views of numerous biological parameters These data can be analyzed and processed by the program It manages database connection and data storage e Running computer external device it provides the major part of input data In particular it furnishes body parameters about each race or training session 11 2 Existing project The following figure shows the system s elements and the exchanged data flow Training session data atleta Stored log data Data analysis and data visualization Training session data and analyzed data Figure 2 2 System s elements 12 2 4 Project description 2 4 1 Database Existing database is composed by tables which contain the whole training system infor mation It is planned to store a great quantity of data They are related to numerous athletics teams each one is comp
110. king the program code understand how handle it and how make future modifi cations e Identify user requirements watching the whole system understand its function ing and its faults related on the project s objective These last ones are very impor tant because they signal which parts have to be developed 151 C Work planning e Identify work identify work already done and according with the user require ments identify where improvements are needed Choose which improvements will be implemented e Identify work specifications it means to understand which elements data and information are interesting and useful to implement this work Also deciding which data have to be extracting from the Database which ones have to be processed and analyzed The main phase of the current work is clearly the DEVELOPMENT one It is divided into e Analysis of the algorithms starting from all parameters which are involved into the calculation of different kinds of statistics this phase consists of the creation of algorithms to achieve these goals More in detail three algorithms have been studied and created to calculate exertion gradient and bend statistics e Program implementation this phase is concurrently with the analysis of the al gorithms and the program test It is the longest phase of the project because it consists of programming the new planned functionalities using the Visual Studio 2005 framework The
111. know after each session when he she is able to start the next one The exertion count rapidly reveals when easy days have come and if the load has been constant or inconstant The heart rate level achieved during light recovery exercises accurately demonstrates the body s exertion level When recovery has been unsuccessful the heart rate tends to rise and speed to decrease In addition to heart rate and speed subjective feelings during the exercise are also an essential part of evaluating the exertion level AII three variables heart rate speed and feelings describe the exertion level Sometimes changes are apparent in only one of the above factors When heart rate speed and feelings are regularly monitored during light and recovery exercises the athlete is able to immediately react to changes in the above factors This ensures optimal development and helps to avoid overexertion The graph in the next page can be observed in order to clarify this concept The graph compares two exercises performed in two different states of recovery The 57 4 Analysis algorithms objective of the exercises has been to perform a steady paced light run Moreover the exercises have been performed in the same place The lower heart rate curve corresponds to an exercise performed after proper recovery The athlete s subjective feeling has been good The average heart rate is 127 bpm and speed 4 26 min km The upper heart rate curve corresponds to an exer
112. lar limit as sum subtraction of segmentGradient and gradientFactor 8 perform a two level tolerance control if gradient calculated at 4 exceeds the toler ance range 8 1 if gradient calculated at 6 exceeds the tolerance range 8 1 1 current point is not part of previous line segment because it is out of range 8 1 2 store data related to previous line segment It goes from starting point to 1 1 point 74 4 2 Gradient algorithm 8 1 3 set previous point as the new starting point 9 update mean segment s gradient segmentGradient 10 retrieve relative distance and relative altitude between current point 1 and previous point 1 1 11 calculate gradient of the segment delimited by current point 1 and previous point i 1 12 calculate tolerance range the maximum maxRange and minimum minRange an gular limit as sum subtraction of segmentGradient and gradientFactor 13 perform a single level tolerance control if gradient calculated at 11 exceeds the tolerance range 13 1 last track point current point is not part of previous line segment because it is out of range 13 2 store data related to previous line segment It goes from starting point to 1 1 point 13 3 set previous point as the new starting point 13 4 store data related to the last line segment It goes from previous point 1 1 point to current and last track point 14 else last track point current point is part of previous line segment last tra
113. le between two points so it is impos sible to establish which algorithm is the best one e modifying the angular limit it is possible to obtain many precision levels The algorithm idea is that a point belongs to a certain line segment if the gradient of the segment line delimited by the same point and the previous one respect to the average gradient value of the line segment does not exceed a calculated threshold expressed in terms of decimal degrees This is the basic idea of the gradient algorithm that functions very well if the track has steep climbs or large slopes exactly as shown in the following picture Gradient 3417 3631 39 3916 61 Distance Figure 4 5 Climbs and slopes 65 4 Analysis algorithms The decision threshold allows that there will be a little angular margin between two different gradient values both in slope and in climb For this reason it is possible to obtain profiles like the following one Gradient 39 1229 40 0581 40 9933 41 9285 42 8637 43 7989 44 7341 45 6693 46 6045 47 5397 48 4749 6996 17 7144 98 7293 79 7442 6 7591 41 7740 22 Distance Altitude Figure 4 6 Gradient view Moreover a last consideration has to be made In reality lots of tracks have a different profile in terms of altitude For example mountain roads with lot of ups and downs can be easily imagined
114. mente Ci si traduce in una differenza in termini di velocit e consumo energetico a seconda che l atleta percorra una curva a destra piuttosto che una a sinistra Per questo motivo percorrere un tracciato in una direzione o in quella opposta pu comportare una differenza di prestazione algoritmo implementato prende in esame il tracciato di gara o di allenamento rap presentandolo ed esaminandolo come una sequenza di segmenti I dati a disposizione sono le coordinate topografiche rilevate utilizzando un apparecchio GPS Global Position System e sono rappresentati mediante un grafico Cartesiano Le coordinate Cartesiane vengono trasformate in coordinate Polari per una pi semplice analisi in questo modo non si hanno a disposizione punti ma segmenti L elaborazione successiva coinvolge una coppia di segmenti adiacenti alla volta a seconda dell ampiezza dell angolo tra essi compreso si presenta uno dei seguenti casi e se il valore angolare molto elevato e supera la soglia prestabilita angolo limite non c alcuna curva e se l angolo ha un ampiezza che non supera l angolo limite si presentano due alter native si in presenza di una curva se la curva precedente pi distante di una certa soglia distanza limite oppure se la curva precedente nell altra direzione non c una nuova curva poich quella in esame fa parte di una curva pi grande delimitata da pi di due segmenti consecutivi L algoritmo c
115. mize TL Y yi Bo bixi 3 11 i 1 The null hypothesis is Ho B Br 0 3 12 It follows that the alternate hypothesis is Calling a the significance level it is possible to have only two scenarios ifa lt p value Ho is accepted if a gt p value Ho is rejected Normally if Ho is rejected the linear regression fits the given data set Final clarifications are needed because there are several common misunderstandings about p value Here the most frequents are reported 1 The p value is not the probability that the null hypothesis is true claimed to justify the rule of considering as significant p values closer to 0 In fact it is not possible to attach probabilities to hypotheses 2 The p value is not the probability of falsely rejecting the null hypothesis 3 The p value is not the probability that a replicating experiment would not yield the same conclusion 4 p value is not the probability of the alternative hypothesis being true 51 3 Statistical software 6 The significance level of the test is not determined by the p value The significance level of a test is a value that should be decided upon by the agent interpreting the data before the data are viewed It is compared against the p value or any other statistic calculated after the test has been performed The p value does not indicate the size or importance of the observed effect Finally in appendix B 3 is
116. mmands is possible For this reason the local method calls R remote functions to perform the linear regression between the past vector and it calls others commands to store results In this way the local method can receive the subsequent processed data from the statistical software as well as the graphics and text outputs this last operation is possible using the GraphicDevice and the CharacterOutputDevice ActiveX controls The function that allows all how just explained is quoted in appendix see appendix B 3 5 2 2 Exertion classes The involved classes that perform the exertion calculation and analysis are e treeTestView exertion View exertionViewWeekly ExertionCalculator gestorDisc CdialogManager classes 100 5 2 Conceptual model exertionCalculator getExertionDay float llistalntervalHRLog descriptiveStatFC float Figure 5 4 UML diagram for exertion treeTest view class It retrieves from the system the athlete s name and the identifier of the select log it passes this parameters to the related method of exertionView class exertion View class This class receives the athlete s name from treeTestView it calculates the one month be fore date and performs one call to the ExertionCalculator class for each day of the esti mated month His function is to show to the user the monthly variation of the exertion factor For each day the graph shows others correlated values
117. mum log altitude expressed in meter distAscendent DECIMAL 12 3 Log covered rising distance expressed in meter distDescendent DECIMAL 12 3 Log covered falling distance expressed in meter distPla DECIMAL 12 3 Log covered plan distance expressed in meter tempDiscendent TIME Log rising time tempAscendent TIME Log falling time tempsPla TIME Log plain time velocitatMinima DECIMAL 12 2 Minimum log speed express in min per Km velocitatMaxima DECIMAL 12 2 Maximum log speed express in min per Km intervalMostreig TIME Sampling time 131 A Database specifics INTERVALHR LOG This table allows to save the log time past in every HR interval of each athlete FIELD DATA TYPE NOTE DESCRIPTION identificador VARCHAR 25 PK User identifier Usuari idLog VARCHAR 14 PK Log identifier maxHR UNSIGNED PK Maximum interval Heart Frequency INT 3 expressed in beat per minute minHR UNSIGNED PK Minimum interval Heart Frequency INT 3 expressed in beat per minute tempsZona TIME INTERVALHR LOG MARCA This table allows to save the log time past in every HR interval of each athlete divided by label FIELD identificadorUsuan idLog idMarca idLogMarca idUsuariMarca maxHR minHR tempsZona DATA TYPE VARCHAR 25 VARCHAR 14 VARCHAR 25 VARCHAR 12 VARCHAR 25 UNSIGNED INT 3 UNSIGNED INT 3 TIME Past time in the related HR interval NOTE DESCRIPTION PK User identifier PK Log identifier PK Label i
118. n It is important to state that in this phase of the project development not all sports are considered so we regard only models belong at the RUNNING category 20 2 4 Project description 32 ou Max ventilation Max oxygen cons vO2 Kcal EPOC Min HR Max HR Average HR Initial time Finish time Date Max speed Min speed Average speed Step number Max altitude Min altitude Climb time Slide time Plan time Distance Latitude Longitude Duration Pressure Temperature Lap time gt lt lt OK X X X X X Xx x KK KKK x x KKK x gt lt gt lt gt lt x x 38 gt lt OK X X X x x Figure 2 4 Suunto products 21 2 Existing project POR RS RS ds Rei Ridi 200SD 400SD 00SD AHI x AHI x X OX dd dd Xx gt lt X X X Xx Xx xx gt lt PK X OK OOK X OOK Xx gt lt X X X Xx X x OK OK Max ventilation Max oxyg cons VO2 Kcal EPOC Min HR Max HR Average HR Initial time Finish time Date Max speed Min speed Average speed Step number Max altitude Min altitude Climb time Slide time Plan time Distance Latitude Longitude Duration Pressure Temperature Figure 2 5 Polar products 22 2 4 Project description Max ventilation Max oxygen consumption vO2 Kcal EPOC Min HR Max HR Average HR Initial time Finish time Date Max speed Min speed Average speed Step number Max altitude Min altitude Climb time Slide time Plan t
119. n componente fondamentalmente una unit base che pu incapsulare al suo interno funzioni metodi dati propriet e stati In riferimento a quanto detto importante conoscere la corretta nomenclatura e un componente detto COM DCOM server e l utilizzatore di un componente detto COM DCOM client Il package R SERVER contiene un DCOM server utilizzato per connettere un applica zione client con R Come stato accennato in precedenza il package R SERVER fornisce un interfaccia COM a R esattamente nello stesso modo in cui oggetti COM e controlli ActiveX le forniscono alle applicazioni che li supportano R D COM server possiede i meccanismi per connettersi con e applicazioni standard ad esempio Microsoft Excel e applicazioni scritte in qualsiasi linguaggio di programmazione che svolgono la funzione di COM DCOM client esse usano il motore computazionale di R e ne ricavano gli output grafici e testuali La figura nella pagina seguente mostra le relazioni esistenti tra gli elementi appena descritti 11 XIV ATLETA R server DCOM Object Users PC Figura 1 2 Struttura del collegamento ad R Osservando lo schema precedente si pu notare che il cuore della connessione R server il quale rappresenta l anello di congiunzione tra R ed il software Atleta Atleta e PR client al quale consentito l accesso alle funzionalit di R R server in gra do di gestire il caso in cui vi
120. n the user s PC registry because they give some information about the software They are usually parameters such as the software version and they are very important because they can be read and tested during the installation phase of any software 3 User interface editor it is used to display information about installation state It provides for the standard dialogs that being displayed into all the three installation phases start progress and end Text to be displayed can be easily and rapidly edited using the provided menu 4 Custom Action editor it allows to add actions to be performed during a particular installation uninstallation state install commit rollback uninstall The program mer can add actions to be executed depending on the state in which the installation is in For example this operations are very important when something goes wrong during the installation phase in this case the execution state is set to rollback and the machine has to perform some actions to restore the default situation 119 5 Implementation 5 Launch Conditions editor developer can set conditions which stop the install execution if they are not verified Usually this options are used to check if all pre requisites of the program are correctly installed To perform this test it is necessary to check some registry key entry By using the described editors a Setup project has been implemented in order to im prove Atleta so
121. ning Plan it is a group of different plans related to a single athlete e Function at the moment the following functions are available which are grouped by general thematic areas security data confidentiality is guaranteed by the initial login procedure that asks the user s name and password Accounts can be created and subsequently edited There are two types of account trainer or athlete The trainer user can manage personal and all training data logs about all the athletes of his team whereas athlete user can only see his owns All the user data can be modified or edited or cancelled in any moment Calendar by choosing a particular date it is possible to get an association with more than one Training Plan or simply more than one Plan Log it could be imported or exported through the use of an XML file that stores the data in a structured and fixed way A log can be modified by the athlete or by his trainer It is allowed to know which plan is associated with the log to group more logs under a common root and to split a log in two or more parts In particular this is a temporal division Log comparison it is possible to compare two different logs the software shows their parameters values maximum minimum and average value be tween them Graphs the software has lots of different graphic views It has the goal to show in the best way the training data of any log It is possible to see only
122. no del programma Esse sono log sono i dati provenienti dal pulsometro propriamente detti Ciascuno di es si fa riferimento ad un unica sessione di allenamento Tutti i dettagli originali sono visualizzati ciascuno con la propria unit di misura Piani di allenamento corrispondono agli allenamenti tipo che possono essere organizzati ed elaborati Programmi di allenamento sono raggruppamenti di pi piani di allenamento secondo un denominatore comune e Funzioni svolte al momento attuale sono disponibili le seguenti funzioni raggrup pate per grandi aree tematiche sicurezza la riservatezza dei dati garantita dalla possibilit di effettuare il login con la propria password Gli account possono essere creati ed esistono due tipi di utente allenatore e l atleta Mentre il primo ha a disposizione i dati personali ed 1 log relativi a tutti gli atleti della sua squadra l utente atleta puo solamente visualizzare i propri Le informazioni utenti possono essere modificate o cancellate in qualsiasi momento Calendario scegliendo il giorno del calendario possibile associare ad una particolare data pi piani di allenamento e o pi programmi di allenamento Log pu essere importato o esportato all esterno attraverso l utilizzo di un file in formato XML Il log pu essere modificato dall utente o dall allenatore possibile vedere quale piano associato ad un log raggruppare pi log
123. nt values are calculated the algorithm updates the value of the current general line segment gradient It is calculated as average of all the sub line segment gradients which are composing at the moment the questioned line segment The algorithm operates a comparison between it and the evaluated fictitious gradients calculated in advance This comparison establishes if the current point i could be part of 69 4 Analysis algorithms the current line segment The i 1 and i 2 points represent the future development of the track and for this reason assume a great importance in this decision They can avoid errors due to little track oscillations or wrong stored altitude values It is also important to notice that an angular threshold exists defined and configured by users to perform this comparison The i point belong to the line segment if one of the following conditions is satisfied e if gradient of s1 does not exceed the angular threshold e if gradient of s2 does not exceed the angular threshold e if gradient of s3 does not exceed the angular threshold Observing this rule it is easy to notice that 1 point does not belong to the line segment only in the case that all three fictitious gradients exceed the angular threshold For this reason different scenarios could be presented IE 1 current point belong to the line segment because 1 point does not exceed the an gular
124. nterfaccia consente all utente di modificare i due importanti parametri coinvolti nell algoritmo l angolo limite e la distanza limite Se tali parametri vengono modificati il software riesegue l algoritmo ed aggiorna i valori delle statistiche L utente ha la possibilit di consultare i dati esaustivi relativi a ciascuna curva cliccando sull apposito bottone 1 7 Conclusioni Al termine del lavoro effettuato si possono trarre le conclusioni su ci che stato conse guito L attivit di tesi ha portato alla definizione di nuove ed importanti funzionalit del software Atleta In particolare e stata creata la struttura atta a compiere la regressione lineare dei dati presenti nel database del sistema Attraverso un opportuna interfaccia e possibile scegliere su quali dati effettuare la regressione lineare ed automaticamente il sistema provvede a connettersi ad R inviare le informazioni necessarie e ricevere il risul tato delle elaborazioni in pochi istanti Queste ultime sono mostrate all utente sotto forma grafica e corredate dai pi importanti dati statistici associati La regressione lineare non si effettua su tutti i dati biologici che si hanno a disposizione ma solamente su quelli che so no stati selezionati in base alla rilevanza che assumono dal punto di vista medico sportivo XXVIII L obiettivo di questo lavoro non stato quello di effettuare profonde ed elaborate analisi statistiche dei dati bensi quello di impostare una in
125. ompie una roto traslazione degli assi cartesiani per ogni coppia di seg menti adiacenti in modo tale da sovrapporre l asse delle ascisse con il primo dei due XXV segmenti considerati Questa operazione essenziale per stabilire in base alla posizio ne del secondo segmento la direzione della curva in esame Il seguente schema aiuta a chiarire il concetto esposto Figura 1 9 Configurazione standard degli assi XXVI Figura 1 10 Roto traslazione degli assi XXVII Riassumendo quanto detto finora l algoritmo riconosce in quale scenario si trova la curva analizzata e ne provvede ad immagazzinare i parametri associati quali la frequenza cardiaca la velocit la pendenza ed il consumo energetico Nel caso in cui una curva sia composta da pi di due segmenti consecutivi i predetti parametri sono calcolati come valore medio tra tutti quelli coinvolti Per quanto concerne l implementazione la classe bendView consente di visualizzare la planimetria del tracciato e fornisce numerose statistiche associate quali l ampiezza massima minima e media dell angolo della curva la percentuale di curve a destra ed a sinistra sul numero totale di curve la frequenza cardiaca media la velocit media e la pendenza media Esistono poi due tipi di statistiche riassuntive la prima suddivide le informazioni citate in intervalli di ampiezza di angolo della curva mentre la seconda raggruppa i valori in base a range di pendenza Inoltre l i
126. onView Weekly has a different time setting and for this reason works only about a week before the today date and not about a month ExertionCalculator class It represents an intermediate point between the exertionView class and the gestorDisc one It contains the exertion calculation algorithm based on the user guide of POLAR Precision Performance Software 2 see paragraph 4 1 It is essentially composed by a unique function that is called by exertionView or exertionViewWeekly and receives the athlete s id the selected date a exertion factors vector and a value representing the sport factor It interrogates the DB to obtain all logs that behave to the selected day and then it retrieves the time spent for each HR interval of all logs These are the basic values of the exertion calculation It implements the algorithm and it stores the result into a special structure It is important to notice that if there is more than one log in a day the related exertion values are calculated and added It also stores average HR maximum 102 5 2 Conceptual model HR average speed and maximum speed of a day obviously managing the fact that it is possible to have more logs in a day gestorDisc class It passes data which are stored in a vector 9 to ExertionCalculator In this case they can be descriptive statistics log identifiers or HR interval structure The implemented methods are llistaLogs Date string idU string date It retu
127. onsente di connettere il software statistico con qualsiasi altra applicazione scritta con i pi comuni linguaggi di programmazione R SERVER definito come un DCOM server che contiene un interfaccia COM a R Per comprenderne la definizione necessario conoscere la nomenclatura di tali acronimi COM Component Object Model una piattaforma software introdotta da Micro soft 5 nel 1993 Questa tecnologia nata per permettere la comunicazione tra processi e la creazione dinamica di oggetti si adatta ad ogni linguaggio di programmazione che la supporti I componenti oggetto COM sono implementati in un linguaggio neutrale non conosciuto da chi ne fa uso e possono essere visti come una scatola chiusa di cui non si conoscono i meccanismi interni Tali oggetti possono essere inseriti in qualsiasi ambiente ed utilizzati mediante l interfaccia di cui sono provvisti DCOM Distributed Component Object Model un altra tecnologia sviluppata da Microsoft per consentire la comunicazione tra componenti software distribuiti su una rete di computer DCOM estende dunque il concetto COM aggiungendovi la gestione della comunicazione distribuita tra oggetti XIII Come descritto gli oggetti COM DCOM definiscono uno standard per l interopera bilit ed assumono una funzione molto simile a quella di una libreria Questa tecnica di programmazione simile al paradigma ad oggetti pi correttamente definita a componenti U
128. or years in this kind of projects These projects could involve a broad spectrum of activities some producers make professional instru ments capable of store body parameters of athletes others offer analysis services of these data as decision support system about the physical state of a person others make special sportswear depending on the sporting discipline Furthermore numerous new specialized sports centers have been created generally from sports clubs of great importance There high technology and specialized staff are used to achieve the improvement of athletes performances 1 Introduction Into this complex scenario the project called Atleta was born at the UPC Univer sitat Polit cnica de Catalunya in Barcelona This project managed by the Professor Pau Fonseca i Casas is put in the area of interest of the body data analysis It was devised after a long and deep research about similar products present in the market By analyzing all the characteristics of Atleta strong and weak points its limitations many possibil ities of future improvements have been highlighted Leader companies in this market s sector have been taken as a model in particular three worldwide companies POLAR GARMIN and SUUNTO They produce professional training computers and furnish to their customers their own software It provides to visualize and manage data retrieved during any race or training session Biological data are not subject
129. ort them in the developed custom application Multiple local remote server applications the current implementation of the R server package puts every single R interpreter used in a client application into a separate address space It also allows different code and data segments for multiple instances of the interpreter even in a single client instance Multiple local remote clients using COM DCOM to expose R s functionality to client applications even makes it possible to share a single instance of an R interpreter between multiple client applications both running on the same or even on different machines in the network Sharing an interpreter instance also implies a shared data and code segment for R The implementation using COM takes care of synchroniz ing access to the interpreter so only one client can use the server s functionality at the same time 34 3 2 Embedding R in applications on MS Windows Finally it is important to state that clients and servers can communicate only using COM DCOM objects COM DCOM object is the media that allows communications and data exchanges It is composed by two parts e COM interface which contains methods functions and operations and properties variables visible by clients It also contains its internal state that is invisible by clients This interface represents the unique entry point to the object an important characteristic is that it must not be changed at all even new me
130. osed by 20 athletes Information could be personal data biological parameters and characteristics of every athlete and body data about all training session or race done Only topographic tracks information are not stored in the DB This is due to the fact that they are so many that it is not convenient to save them In agreement with the project manager it is been decided to retrieve track information from external file when it is needed to analyze them and not to store them into the local system Finally the database is a MySQL DB 4 which provides all functionalities needed without any license costs It is accessed by using the MySQL library 13 described in the next paragraph More in detail the database structure is described by the following figure 13 2 Existing project associa log pla planificat idLog dia nomPla IdentificedorUsuan identificadorPia logextern horaFi maxHR minHR maxAltitud minAFitud distAscendent distDescenden distPla tempsAscendent tempsDescendent tempsPla intervalMostreig velocitatMinima velocitatMaxima PK PK nomPla PK FK1 13 11 identificador PK I1 idLog PK FK1 2 nomPla PK FK1 identificador PK FK1 2 nomPrograma PK WentificadorUsuari PK I2 identificadorPla icadorUsuari PK It idLog PKI identifi nomPla nomPrograma Identificador activitat distancia durada E ES OPEN identificador namPla activitat distancia durada nates
131. ossible without the contributions of the Prof Pau Fonseca i Casas and the Prof Elena Baralis I am grateful for his and her time suggestions and detailed comments On my personal side I would like to acknowledge my family who has always supported me during these years at the University and has believed in me XXXV Contents Sommario HI Li IOS a as a gra d ac ast dada SR ROS VR RU ae Rs IV L2 Descrizione del sistema esistente lt o zm REX REX VIII 121 ESE ocaso IX 1 2 2 Ilsoftware Atleta ia Rm 909 DERE ERG x 1 23 IL polsomett cocidas guies si XI 1 3 Software statistic ers she a SEG SIG s REX sx s XII 134 CONGU NIE lt oux xac quo oec mmm ee ee x XII 13 3 Regressione lineare usando RR XVII 1 3 3 Motivazioni biomediche della regressione lineare XVII 1 4 Algoritmo di analisi dello sforzo fisico XIX 1 5 Algoritmo di analisi della pendenza del tracciato XXII 1 6 Algoritmo di analisi delle curve del tracciato XXV LT COMIC gt s eo ee C4 RE P P ORCI HL A ER Le a XXVIII Summary XXXIII Acknowledgements XXXV 1 Introduction 1 2 Existing project 3 CA o eu s roo Eo RR SR RR RC ER RR a eu a 5 XXXVII 22 Current situation 7 7s 29 Project guidelines 4224 Roce aed x4 beg RE qu de qe ge es 2 Project description uu ks DESPESES Ew RE OE EOE SS 24l IAE senean ea Fw a Se Oe CO 3 24 2 Allet
132. performance level will decline even more and the recovery will take longer Respectively if the next session is delayed and is done when the su percompensation phase is over the net effect of multiple sessions will be close to zero The exertion count is designed to make all exercise sessions measurable referring to sport duration and intensity level As mentioned before the most useful information from the exertion count comes when one learns to relate his her exertion level to the time needed for recovery after a single training session The figure in the next page shows a schematic view of the sugges tive relationship between exertion and recovery time The values used are personalized 56 4 1 Exertion algorithm Therefore a record of his her own experiences and findings should be kept for several weeks before applying this analysis A A i Bees 0 100 200 3000 400 i i i Exertion count H H H H 0 8 16 24 32 Recovery time h Figure 4 2 A schematic relationship between exertion count and recovery time The previous figure shows for example that for a exertion value of about 300 the related recovery time is of about one day Past this time the athlete is able to perform a new training session because his her body is in the supercompensation phase When one has found out how his her own exertion factors relate to recovery he she can easily control his her training in advance It is also possible to
133. pone di creare un prodotto nuovo rispetto a quelli oggigiorno in com mercio Le carenze dei prodotti presenti sul mercato divengono dunque 1 punti di forza di questo progetto Facendo uso dei pulsometri delle gi citate case costruttrici il soft ware Atleta concepito per essere uno strumento standard in grado cio di acquisire ed elaborare dati provenienti da qualsivoglia strumento indipendentemente dalla marca o dal modello di quest ultimo I dati raccolti vengono tradotti e mappati in un file in formato standard XML si veda il paragrafo 2 4 3 e successivamente salvati in un data base MySQL Da un lato 1 dati vengono visualizzati all utente sotto forma di grafico o di tabella in maniera tale da far risaltare quelli pi importanti e significativi dall altro subiscono elaborazioni pi complesse al fine di calcolare numerosi parametri biologici utili per monitorare e migliorare delicati aspetti della preparazione atletica Tali parametri biologici ricavati da calcoli effettuati sui dati originari in ingresso rappresentano fattori e variabili che verranno immessi come input nel DSS ed andranno dunque ad incidere nella simulazione delle prestazioni di un atleta La presente Tesi di laurea si occupa di descrivere il lavoro di collaborazione ed il ruo lo assunto dal sottoscritto nello sviluppo del progetto Atleta Per volgere al termine il progetto Atleta prevede il completamento di numerose ed elaborate fasi di lavoro esse sono state d
134. presso la UPC Universitat Polit cnica IV de Catalunya di Barcellona il progetto denominato Atleta Tale progetto curato dal Pro fessor Pau Fonseca 1 Casas si colloca nell ambito dell analisi dei dati sportivi Atleta stato ideato a seguito di una lunga ed approfondita analisi relativamente ai prodotti esi stenti sul mercato Detta ricerca ne ha preso in esame le caratteristiche i punti forti e quelli deboli al fine di evidenziarne 1 limiti le carenze e tutte le future possibilit di sviluppo Sono stati presi come modello per l analisi le aziende leader in questo settore in partico lare si tratta di tre aziende di rilievo internazionale POLAR GARMIN e SUUNTO Tali imprese producono pulsometri professionali e forniscono al cliente software proprietari che una volta installati sul proprio PC provvedono a visualizzare e gestire 1 dati raccolti durante una gara od una qualsiasi sessione di allenamento I parametri biologici raccolti non subiscono tuttavia profonde analisi ma nella maggior parte dei casi vengono sola mente mostrati all utente sotto forma di grafico o di tabella Ci significa che rispetto alle informazioni che il pulsometro stesso fornisce in tempo reale durante il periodo di attivit fisica il software non introduce sostanziali novit se non quella di mostrare i dati in forma pi leggibile Inoltre l utente deve necessariamente utilizzare il software for nito dalla ditta costruttrice dell apparecchio che ha a
135. previous point 1 1 and the following ones i 1 and i 2 Intuitively the line segments names are s1 s 1 and s 2 respectively Furthermore it is important to state that in the gradient calcu lation the distance between two points has been intended as horizontal distance and not as inclined one Since the majority of distance data are originated by GPS devices the undersigned has utilized the topographic approach that works in this way In addition the difference between the two distances is so little that can be assumed as nonessential and the precision of the calculation is not affected by errors The gradient is expressed by the o angle of a right angled triangle as shown 68 4 2 Gradient algorithm a l a Figure 4 9 Right angled triangle Using the trigonometry law the formula for a angle is the following a arctan 4 4 2 a And it follows that the formula for gradient is grt arctan SS 4 3 distance The C programming language offers a library to developers math h which con tains lot of mathematics functions 2 The formula for gradient which has been used in this project has been lightly modified because math h can only manage radiant angles but to be more user friendly the Atleta interface show only decimal degrees The final formula for gradient calculation is tud 1 m arctan s u jJ 80 44 distance T Once the three fictitious gradie
136. profile RS800SD RS800SD S625X and S8101 have some data about track profile as for example altitude but they do not provide particular details as GPS coordinates 23 2 Existing project rior F201 F301 F205 F305 AE Figure 2 9 Garmin missing data Initial time Finish time Date Track profile HR data All GARMIN devices have installed a GPS so the exact profile of the training track can be known GARMIN software does not analyze deeply body data and does not furnish estimated values of EPOC VO2 and oxygen consumption Therefore low level products as F101 F201 and F205 do not store any body data Finally it is important to state that the market research has been made in April 2007 during the initial phase of this thesis and all the information about the mentioned param eters and device specifications are referred to this date Format file POLAR SUUNTO and GARMIN products generate data which are the point of departure of the following analysis Each company develops its own format file which can be read only by its own software product In fact when training session data are transferred from the device to the PC they are saved as a file Subsequently the software opens it and shows the results to the user More in particular some details about the different format files are reported e POLAR devices produce files with hrm extension e GARMIN training computers generate files
137. quals 1 0 all points lie exactly on a straight line with no scatter Knowing x let predict y perfectly For example a r value of 47 3 Statistical software 0 726 indicates that 72 696 of the variation in one variable may be explained by the other Finally it is very important to remember that the absence of linear relationship be tween variables does not mean that any relationship between them does not exist 3 5 Linear regression using R Modern statistical software can execute steps described in the previous paragraph auto matically performing calculation in few instants In particular by using the statistical software R a linear regression can be performed following these few passages 12 1 data set declaration each data set has to be filled in vectorial form 2 linear regression command using the command 1m it is possible to perform the linear regression between variables 3 data set display typing plot it is possible to obtain a graphic representation scat terplot of the used data set 4 fitting line display the abline command is used to display the calculated fitting line 5 show results the summary command is useful to show all information about the linear regression just performed The following example is useful to understand immediately previous points xs La a 4 Mo 7 B 9 20 32 12 ws 23 0 21 5 22 1 21 9 21 8 21 4 22 5 22 32 22 4 42 3 42 4 24 9 gt result 1m y x gt
138. r as default value 13 User can choose the previous month view 15 User can resetthe month view 17 Used can select the preferred linear regression view choosing from different buttons 20 User can choose the week view Exceptions SYSTEM 2 12 14 16 18 19 21 System performs the exertion algorithm shows the monthly exertion view and the related statistics It checks the correctness of the filled data values System performs again the exertion algorithm shows the track profile and the related statistics System performs again the exertion algorithm shows the track profile and the related statistics It checks the correctness of the filled data value System performs again the exertion algorithm shows the track profile and the related statistics System performs again the exertion algorithm shows the track profile and the related statistics System displays the previous month statistics System displays the current month statistics It checks the correctness of the data to process System establishes a connection with R and shows the linear regression graph the textual output and the descriptive statistics of the two parameters involved System displays the weekly view panel e Step 4 the system checks if the filled values are too low or too high and asks user confirmation by showing a warning message box 94 5 2 Conceptual model e Step 9 the system checks if t
139. re 4 19 Axis standard configuration 80 4 3 Bend algorithm Figure 4 20 Axes roto translation With this new axis s configuration the new axis origin is represented by point A and X axis is superimposed to the first line segment s1 In this way the only coordinates that have to be estimated are related to point C In order to calculate them it is necessary to use the following formulas to zc 24 cosa yc ya sina 4 10 1 Yo xc A sina yc ya cosa 4 11 81 4 Analysis algorithms Once the roto translation has been performed and one knows the new relative coordi nates of C point zo Yo the bend s side is easy to determine leftif yo X 0 rightif yo lt 0 The last point that has to be analyzed is bend sequence In fact different configura tions and scenarios will be developed e different bends with different sides the software analyses the points it also detects that there are two different bends even if the points B and C would be under the distance threshold Figure 4 21 Different bends with different sides 82 4 3 Bend algorithm e Different bends on the same side the algorithm analyses the points and detects that there are two different bends on the same side This is due to the fact that the distance between them is too large in comparison with fixed distance threshold Figure 4 22 D
140. requency 28 Chapter 3 Statistical software An important part of this thesis is focused on the creation of a structure able to perform statistical data analysis The MySQL database only provides simple descriptive statistics such as maximum minimum and average value of stored data In order to perform sta tistical analysis it is necessary to use more powerful instruments After researches in which all possible solutions have been studied it has been decided to do not implement any special C classes for this purpose but to utilize an existing statistical software This approach is the result of the following considerations to implement every statistical function means to spend much time studying and deeply understanding the functioning of every mathematical instrument that have to be used Furthermore there is a high probability of error in development of algorithm calculations On the contrary statistical software ensures reliability a high precision level and provides a large number of simple and complex functions The last point represents a very important feature because once the structure has been created it can be easily adapted and used to new and different sta tistical analysis In terms of rapidity simplicity precision and future potentiality to use an existing statistical software guarantees a better result A large number of statistical software can be found on the market In terms of preci sion level and reliability
141. rns logs that behave to a particular athlete in a particular date llistalntervalHRLog string idLog string idU This function returns an HR intervals list associate to a specific log It stores results into a particular structure called registre intervalHRLog which contains maxi mum and minimum HR the log ID the user ID and the time value About descriptive statistics there are the following methods already described into the Linear Regression section 5 2 1 descriptiveStatSpeed string idLog string idU Speed average maximum and minimum values descriptiveStatFC string idLog string idU HR average maximum and minimum values CdialogManager classes Following classes belong to this category RgraphExertionHRMax RgraphExertionMeanHR RgraphExertionMaxSpeed RgraphExertionMeanSpeed 103 5 Implementation They implement a linear regression view Each class shows a couple of different vari able but their code structure and functioning is the same Their function is essentially to display parameters that they receive from exertionView or exertionView Weekly In partic ular they are the vectors of exertion and the selected parameter values 5 2 3 Gradient classes The involved classes that perform the exertion calculation and analysis are e treeTestView gradientView gradientViewDetail gestorDisc CdialogManager classes treeTestView function
142. roject guideline one of the most important leading principle of this work has been the compatibility of the components with the existing system also at presentation level Another planning strategy has been to continue to use worldwide standard to de velop every component An example of this strategy is the connection between R and Atleta by R server which is a frequently updated and developed instrument It guaran tees great longevity to the whole project Another example is the ActiveX technology use for all graph s visualization Finally user interfaces have been developed by following simplicity intuitiveness and immediacy of use criteria Each interface has been planned to have two precision levels the first level contains main information and data summaries which are divided into categories The second one more detailed and complete shows all information about the selected topic As it has previously said many times in the all document my work s contribution at the Atleta project has been focused on the completion of the whole system infrastructure Nowadays the project is still into development phase and there are numerous researchers working on it each one working on a specific aspect There are many areas of interest that are focused both on the development of new capabilities and on the improvement of existing mechanisms An example is the data exchange between system and professional training computers which is not very automati
143. s data and store them in a particular structure called gradient punctual data The implemented method is getGradientPunctualData string usID string logID It returns logs punctual data of altitude distance HR energy consumption and speed CdialogManager classes Following classes belong to this category e RgraphGradientHR e RgraphGradientSpeed e RgraphGradientEnergy They implement a linear regression view exactly in the same way already explained for the linear regression CdialogManager classes at 5 2 1 106 5 2 Conceptual model 5 2 4 Bend classes The involved classes that perform the exertion calculation and analysis are e treeTestView bendView bendViewDetail gestorDisc CdialogManager classes uses bendView function void showTrackStatistics void 1 1 uses OnLinearregressionBend void OnLinearregresionBendTrainer void getBendPunctualData eusess CdialogManager er al Raraph void bendViewDetail function void showTrackDetailedStatistics void Figure 5 6 UML diagram for bend treeTestView class It retrieves from the system the athlete s name and the log identifier and it passes these parameters to bendView class 107 5 Implementation bendView class Bendview class implements the bend algorithm described at paragraph 4 3 which start ing from the topographic track
144. s declaration and setting They are defined as VARIANT 321045 VI R8 that can be associated to the more common double type Only by defining them as VARIANT it is possible to pass them to the R computational engine These lines represent the data exchange from the class to R For example the code of the line 47 generates a R variable called uno and its value is the same 47 to 49 of lVall Notice that not exist any connection or synchronization between the two variables the first belong to the R environment while the second is local and belong to the class Any change of one of them does not have any repercussion on the other one This method is utilized to send commands to the R engine Commands 51 submitted are exactly the same that one uses in the R prompt console In this way R calculates tre as sum of uno and due 54 By using this method is possible to retrieve the variable s value from R All graphs invoked by code and subsequently generated by R are captured by 57 the special Active X control Including it into a normal dialog box it is possible to see the graphs All R textual output is captured and shown by the other Active X control who exactly works in the same way of the hic one Resource releasing lt is really important to notice that only one Active X 61 to 63 control at the same time can be used obviously of the same type Figure 3 7 Notes 3 4 Linear regression s theory As mentioned in chapter 2 one of th
145. s of a SAFEARRAY CComSafeArrayBound bounds 1 bounds 0 SetLowerBound 0 bounds 0 SetCount vectorLength 147 B Code examples A helper for accessing CComSafeArrays by index LONG ix pVarx new VARIANT pVary new VARIANT VariantInit pVarx VariantInit pVary input is SAFEARRAY of doubles pVarx vt VT ARRAY VT R8 output is SAFEARRAY of doubles pVary vt VT ARRAY VT R8 set activeX TEXT OUTPU lConnector SetCharacterOutputDevice lCharDev set activeX Graphic OUTPUT lConnector AddGraphicsDevice T Gfx m Graph dev GetGEX Create the input SAFEARRAY and fill it with values now wraps a SAFEARRAY pComArrX new CComSafeArray double bounds 1 now wraps a SAFEARRAY pComArrY new CComSafeArray double bounds 1 for ix 0 ix lt vectorLength ix pComArrX gt SetAt ix vcl at ix 1 pComArrY gt SetAt ix vc2 at ix 1 point the input VARIANT at the array pVarx parray pComArrX Detach pVary gt parray pComArrY Detach ready to call R lConnector SetSymbol Speed xpVarx 148 B 3 R connection lConnector SetSymbol Energy xpVary regress x on y and store the results lConnector EvaluateNoReturn T result lm Speed Energy PLOT lConnector EvaluateNoReturn T plot Speed Energy col 4 main Speed
146. s very simple for each existing HR interval it multiplies the related exertion factor chosen with relation to the figure 4 4 per time spent in that HR interval Then the algorithm sums all these values and applies the related sport factor Finally it is important to notice that if there is more than one training session in a day the algorithm calculates the daily exertion count as sum of all the exertion counts of each training session 63 4 Analysis algorithms The implemented exertion algorithm is described in detail by the following pseudo code 1 initialize total exertion value of a log at 0 2 execute cycle for all logs of a single day 2 1 initialize partial HR interval exertion at 0 2 2 execute cycle for all athlete s HR intervals 2 2 1 retrieve seconds minutes and hours spent in this HR interval 2 2 2 transform all in minutes multiply hours spent per 60 2 2 3 transform all in minutes divide seconds spent per 60 2 2 4 sum of transformed seconds and transformed hours and minutes 2 2 5 multiply total time spent per related exertion factor 2 2 6 add the calculated partial HR interval exertion 1 to the previous one 1 1 2 3 multiply the total exertion value of a log per the related sport factor 2 4 add the calculated total exertion value of a log 1 to the previous one 1 1 4 2 Gradient algorithm It is very important to know the athlete s performance respect to the altitude development of a track In fa
147. sDevice in BSTR bstrName in ISGFX pDevice Graphic output HRESULT RemoveGraphicsDevice in BSTR bstrName HRESULT SetCharacterOutputDevice in Text output IStatConnectorCharacterDevice pCharDevice Figure 3 4 Interface IStatConnector s output 39 3 Statistical software 3 2 3 Error handling It is based on the assumption that every function returns an HRESULT result For this reason standard COM error handling mechanism exist which uses the macros SUC CEEDED and FAILED to check errors in functions At the moment it could be con sidered a great fault because the mechanism of error handling is not so easy and simply to manage and utilize The most effective example is that errors in every function call must be checked Anyway to ensure the completeness the following table quotes the most common error codes PREPROCESSOR DEFINE VALUE DESCRIPTION SCN E INITIALIZED 0x8004005 lnit not called SCN E NOTINITIALIZED 0x8004006 Init already called SCN E INVALIDSYMBOL 0x8004007 symbol not found SCN E PARSE INVALID 0x8004008 invalid expression SCN E PARSE INCOMPLETE 0x8004009 incomplete expression SCN E UNSUPPORTEDTYPE 0x800400A data type not supported SCN_E_EVALUATE_STOP Ox800400g SValuation stopped because of an error interpreter interface version SCN E INVALIDINTERFACEVERSION 0x8004010 mismatch Rproxy does not match R D COM Server interpreter version SCN E INVALIDINTERPRETERVERSION 0x8004011 m
148. siano pi applicazioni R client che intendano accedere contemporaneamente ad R La comunicazione tra client e server avviene mediante lo scambio di particolari oggetti COM DCOM Tali oggetti rappresentano il mezzo grazie al quale 1 dati possono essere scambiati e sono composti essenzialmente da due elementi e l interfaccia COM che contiene i metodi e le propriet variabili visibili dal client L interfaccia rappresenta l unico punto di accesso all oggetto COM e Il secondo elemento denominato Coclass ed l implementazione dell interfaccia COM Pi Coclass possono implementare la medesima interfaccia IR deve necessariamente essere installato sulla macchina XV In riferimento a quanto detto il seguente diagramma di flusso illustra il ciclo di vita START create COM object Init COM object Init call di un oggetto COM transfer data to R perform computations transfer results to SetSymbol call Evaluate and application EvaluateNoRetum calls GetSymbol call Terminate connection close R Close call release COM object Figura 1 3 Ciclo di vita di un oggetto COM 1 3 2 Regressione lineare usando R Utilizzando il software statistico R la regressione lineare tra due variabili pu essere effettuata in pochi passaggi 12 1 dichiarazione delle variabili ciascuna variabile deve essere inserita in forma di vettore 2 comando per la regressione lineare usando il comando 1m
149. t 1 1 1 7 retrieve relative distance and relative altitude between second point i 2 and previous point i 1 33 4 Analysis algorithms 1 8 calculate gradient of the segment delimited by second next point i 2 and previous point i 1 1 9 calculate tolerance range the maximum maxRange and minimum min Range angular limit as sum subtraction of segmentGradient and gradient Factor 1 10 perform a three level tolerance control if gradient calculated at 1 4 ex ceeds the tolerance range 1 10 1 if gradient calculated at 1 6 exceeds the tolerance range 1 10 1 1 if gradient calculated at 1 8 exceeds the tolerance range 1 10 1 1 1 current point is not part of previous line segment because it is out of range 1 10 1 1 2 store data related to previous line segment It goes from starting point to 1 1 point 1 10 1 1 3 set previous point as the new starting point 1 11 return at the cycle start 1 2 update mean segment s gradient segmentGradient 3 retrieve relative distance and relative altitude between current point 1 and previous point 1 1 4 calculate gradient of the segment delimited by current point 1 and previous point 1 1 5 retrieve relative distance and relative altitude between next point i 1 and previous point 1 1 6 calculate gradient of the segment delimited by next point i 1 and previous point 1 1 7 calculate tolerance range the maximum maxRange and minimum minRange an gu
150. t Frequency interval related to a particular log FIELD DATA TYPE NOTE DESCRIPTION maxHR UNSIGNED PK Maximum intervalHR Heart INT 3 FK Frequency expressed in beat IntervalHR per minute idLog VARCHAR 14 PK Log identifier FK Lo identificador VARCHAR 25 PK User IntervalHR identifier FK IntervalHR Identificador o VARCHAR 25 PK User identifier of the log Lo FK Lo tempsZona TIME IntervalHR duration MESURA TEMPS PLA This table allows to save the time of a particular Heart Frequency interval related to a particular system plan FIELD DATA TYPE NOTE DESCRIPTION maxHR UNSIGNED PK Maximum intervalHR Heart INT 3 FK Frequency expressed in IntervalHR beat per minute nomPla VARCHAR 25 PK System plan name FK Pla identificador VARCHAR 25 PK User IntervalHR identifier FK IntervalHR identificadorPla VARCHAR 25 PK User identifier of the system FK Pla lan tempsZona TIME IntervalHR duration 135 A Database specifics MESURA TEMPS PLA PLANIFICAT This table allows to save the time of a particular Heart Frequency interval related to a particular system plan of a particular date FIELD DATA TYPE NOTE DESCRIPTION maxHR UNSIGNED PK Maximum intervalHR Heart INT 3 FK IntervalHR Frequency expressed in beat per minute dia DATE PK System plan date FK PlaPlanificat nomPla VARCHAR 25 PK System plan name FK PlaPlanificat identificador VARCHAR 25 PK User IntervalHR identifier FK IntervalHR Identi
151. t floatToStri t floatToStri tDlgItem IDC_ t floatToStri SpeedvsEnergy identifier flag 0 IStatConnector lConnector IDispatch lCharDev NULL IDispatch 1GfxDev check NULL tDlgItem IDC_ tDlgItem IDC EDITA ng vecstat2 EDIT5 ng vecstat2 EDIT6 ng vecstat2 146 EDIT1 at 0 c str at 1 c str at 2 c str at 0 c str at 1 c str at 2 c str B 3 R connection if FAILED m Char dev GetControlUnknown QueryInterface IID IDispatch LPVOID amp lCharDev MessageBox Error from Character Device return if FAILED lConnector CreateDispatch T StatConnectorSrv StatConnector MessageBox Error creating StatConnectorSrv return R initialization lConnector Init T R declaration symbol VARIANT lVall l1Val2 VariantInit amp lVall VariantInit amp 1Val2 V VT amp lVall VT R8 V VT amp lVal2 VT R8 declaration SAFEARRAY VARIANT pVarx variant used to hold the vector x ct VARIANT pVary variant used to hold the vector y CComSafeArray is an ATL wrapper for SAFEARRAYs and are T used simply to allow easy access to SAFEARRAY elements CComSafeArray lt double gt pComArrX to hold vector x CComSafeArray lt double gt xpComArrY to hold vector y to specify bound
152. t is called VARIANT The peculiarity of this format is that it can contain any type of data and this is determined by the VARIANT S type VT The main characteristics of VT are the followings e scalar values are supported In particular VT BOOL VT D VT I4 VT UII VT R4 VT R8 VT BSTR VT EMPTY VT ERROR XIErrDivO xIErrNA xIErrNull e Arrays of same scalars of any dimensions represent the optimized data transfer mode e arrays of different scalars generate the mixed transfer mode who is not as effi cient as the previous one COM Object can be transferred from application to R and vice versa It simply utilizes IStatInterface s methods already described Moreover COM Object made possible to send data and retrieve a particular operation or analysis on that Furthermore R text 38 3 2 Embedding R in applications on MS Windows output and R graphic output can be retrieved using two different ways starting from the fact that R D COM Server allows redirection of text and graphics output e Using ActiveX control for capturing text and graphic output available e Using COM object for programmatically capturing text output available In this project the ActiveX approach has been used because it allows a greater sim plicity of use and a more intuitive understanding For this reason additional functions exist in IStatConnector Interface IStatConnector IDispatch t HRESULT AddGraphic
153. t manages life cycle by reference counting and perform object creation It is important to know the right nomenclature e acomponent is called COM DCOM server e auser of component is called COM DCOM client The R SERVER package contains a DCOM server used to connect a client application with R As it was previously said the R SERVER package provides a COM Interface to R as well as various COM objects and ActiveX controls do for many applications R D COM server has got a mechanism for e standard applications like Microsoft Excel e custom applications written in any language to serve as a COM DCOM client they use R as a powerful computational engine and renderer for graphics and text output After this general introduction it is important to understand which the basic elements that compose the R connectivity to Atleta software are and in which way they are related The following figure shows the connections between R client R server and R 11 32 3 2 Embedding R in applications on MS Windows ATLETA R server DCOM Object Users PC Figure 3 1 R connectivity structure As can be observed from the picture above the connection heart is R server which joins R and the software Atleta Atleta represents a R client and it can access to the R engine only by R server This last component controls and manages the access to R if there are more clients at the same time In order to give a summary o
154. ta con una frequenza cardiaca relativamente bassa indice di un ottimo livello di allenamento FREQUENZA CARDIACA ALTITUDINE il fattore che pu essere osservato l adattabilit del fisico all altitudine Ad altitudini elevate circa 2000 m svolge re esercizio fisico pi faticoso che ad altitudini inferiori questo fatto la conse guenza della minor concentrazione di ossigeno nell aria che porta all innalzamento della frequenza cardiaca e di quella respiratoria FREQUENZA CARDIACA DISTANZA il suo sviluppo indica se l atleta alle nato sulla lunga distanza Questo un fattore di secondaria importanza rispetto a i primi due ma rappresenta in ogni caso un aspetto da considerare VELOCIT ALTITUDINE questo parametro molto simile a quello descritto nel punto 2 Mantenere un alta velocit ad alta quota decisamente pi difficile che non ad altitudini inferiori VELOCIT ENERGIA assume significato solamente se considerato in associa zione con valori della frequenza cardiaca distanza e pendenza Tale fattore molto particolare in quanto non indica un parametro fisico bens uno psicologico Esso segnala infatti se un atleta si trova a suo agio o meno nella corsa ad una particolare velocit Alcuni atleti prediligono la corsa a bassa intensit ma per lunghe distanze alcuni corridori non si sentono a proprio agio percorrendo tratti in discesa altri ancora consumano eccessive energi
155. thods cannot be implemented Given that it is an interface it has an abstract definition and it is identified by its IID Interface IDentifier a 128 bit numeric value e The second element is called Coclass which is the implementation of COM inter face As many programming languages allow even in this case multiple Coclasses can implement the same interface Unlike the COM interface the Coclass is iden tified by its CLSID CLass IDentifier a 128 bit numeric value or more simply by its name Coclass is referred to a COM client who is programmed against interface and this reference is established at run time 3 2 1 Interface IStatConnector IStatConnector interface is a COM interface that allows users to connect to R and ex change information with it In fact IStatInterface defines the methods used to access to R Its structure is very simple as the following example code shows They are divided into three thematic blocks 35 3 Statistical software interface IStatConnector IDispatch 1 HRESULT Init in BSTR bstrConnectorName Startup and termination HRESULT Close HRESULT GetSymbol in BSTR bstrSymbolName out retval VARIANT pvData Data transfer HRESULT SetSymbol in BSTR bstrSymbolName in VARIANT vData HRESULT Evaluate in BSTR bstrExpression out retval VARIANT pvData Evaluating HRESULT EvaluateNoReturn in BSTR R code bstrExpression Figure 3 2 StatConnector interf
156. threshold distance Figure 4 10 Case 1 70 4 2 Gradient algorithm 2 current point belong to the line segment because i 1 point does not exceed the angular threshold In this case 1 altitude exceed the angular threshold but the al gorithm considers more important the future track trend This altitude is rejected it can be considered as a wrong value which is due to device errors Here an example 43 8916 44 1084 44 3253 44 5422 44 759 Altitude 44 9759 45 1928 i Figure 4 11 Case 2 graph view The shown graph could be represented in this way altitude si angular threshold 4 i 2 distance Figure 4 12 Case 2 schematic view 71 4 Analysis algorithms 3 current point belong to the line segment because i 2 point does not exceed the angular threshold This case is similar to the previous one but there are two values that are out of scope Next picture will show an example Figure 4 13 Case 3 graph view The shown graph could be represented in this way altitude angular threshold distance Figure 4 14 Case 3 schematic view 72 4 2 Gradient algorithm 4 2 1 The algorithm In order to summarize what has been described until now it can be said that the algorithm works in the following way before deciding if a point could be part of a certain line segment three tests are performed
157. tively minor importance and therefore emphasize the importance of HR measurement in all training sessions Running jogging 1 0 Running is expected to be the most common sport and thus has the factor 1 0 to which other sports are related Aerobics 0 9 1 1 The correct factor of aerobics depends very much on the type of a particular pro gram Typically aerobics consists mainly of dynamic movements mainly involving lower extremity muscles Also the recovery phases if there are any are relatively short The differences between step low high combo are mainly reflected in HR 60 4 1 Exertion algorithm Cycling 1 1 1 2 To reach the same HRs one will have to work approximately 10 to 15 harder in cycling than in running That is mainly due to the slightly slower frequency of cycling the lack of a weight bearing task in cycling and the larger amount of eccentric work in running Mountain biking 1 0 1 1 Mountain biking differs from road cycling as regards the usage of upper body mus cles and the amount of standing Also the varying terrain makes the demands of mountain biking somewhat higher than those of road cycling but mostly these dif ferences are also reflected in the HR Stepping 1 0 1 2 As to the sport factor stepping is very much like cycling as it lacks the eccentric component of work yet requires a relatively large muscle mass However the rhythm of work may impair circulation and thus cause an increase
158. to di favorire l aspetto architetturale della progettazione cercando di suddividere il pi possi bile ciascun ambito e di utilizzare un approccio modulare Grazie ad esso stato possibile fornire un certo grado di estensibilit mediante la quale sar possibile aggiungere nuove funzionalit al progetto senza doverne necessariamente modificare l intera architettura Uno dei principi che ha guidato il lavoro di tesi stato cercare di rendere le diverse com ponenti il pi possibile compatibili con il resto del sistema anche sotto il profilo grafico in maniera tale da rispettare e seguire le linee guida tracciate da chi vi ha lavorato prece dentemente Un ulteriore scelta progettuale stata quella di continuare ad usare standard e raccomandazioni ampiamente accettate a livello internazionale per la realizzazione di ogni componente ne sono esempi la creazione del collegamento con il software statistico XXIX mediante R server strumento in continuo aggiornamento e sviluppo che garantisce gran de longevit al progetto oppure l utilizzo della tecnologia ActiveX per la visualizzazione di tutti 1 grafici Da sottolineare infine che l attivit di creazione delle interfacce utente stata eseguita ponendo particolare attenzione alla semplicit intuitivit ed immediatez za nel loro utilizzo ciascuna interfaccia stata concepita in modo tale da possedere due livelli di precisione un livello principale nel quale sono contenute le inform
159. trumenti per essere utilizzato in remoto da qualsiasi altro software e la sua esauriente documentazione al riguardo ne hanno fatto lo strumento ideale per gli scopi del progetto In questa sezione verr descritta l infrastruttura creata per integrare le funzionalit di R all interno del software Atleta In particolare si sottolinea che l obiettivo di questa attivit non stato quello di eseguire complesse analisi statistiche bensi quello di creare l infrastruttura affinch i futuri ricercatori che collaboreranno al progetto possano utilizzarla per sfruttare al meglio le potenzialit offerte da R La sola analisi statistica implementata stata la regressione lineare dei parametri biologici degli atleti presenti nel database XII 1 3 1 Collegamento ad R Uno degli scopi del progetto Atleta quello di creare un modello di simulazione per poter calcolare in anticipo le prestazioni di un atleta Numerosi solo gli input che devono essere inseriti nel simulatore per svolgere la sua funzione alcuni di essi sono i risulta ti relativi alle regressioni lineari effettuate usando R 8 La regressione lineare uno strumento statistico che consente date due variabili di predirne una conoscendo il valore dell altra Le caratteristiche di R sono state dettagliatamente analizzate per poter ottenerne l in tegrazione all interno di Atleta Lo strumento utilizzato denominato R SERVER esso stato creato da alcuni sviluppatori di R e c
160. used programming language is C e Program tests they have been done very often because are a good index of the work quality Especially testing all possible scenarios and boundary cases in which one can find the major number of bugs e Software integration integration of this work with the existing project Particular attention to menu integration to obtain a more user friendly interface It also include a setup project creation for an easy software installation e Final modification in this phase little details have to be changed or improved to improve the work s quality 152 e Final tests the lasts general controls to be sure that the whole software works correctly 27 oz 18 o1 12 23 63 14 25 06 17 28 s SEIS 22 02 13 24 04 15 26 0 138 days PROJECT ya nq nyy 45 days REVIEW 93 days DEVELOPMENT Analysis of the algorithms 60 days Program implementation 50 days Program tests 12 days Software integration 8 days Final modification Final tests Gantt chart Figure C 1 153 C Work planning The just described activities that compose the whole project work are organized into more sub tasks The following table describes the work organization and shows the re lated working hours considering that some tasks are partially overlapped and a mean working day of
161. voro relativamente a questa parte descritto nel capitolo 3 La seconda tematica af frontata riguarda invece l ideazione di tre algoritmi di analisi di dati relativamente allo sforzo fisico dell atleta al profilo altimetrico del percorso di gara ed alla planimetria della corsa Tali algoritmi hanno lo scopo di visualizzare statistiche relative al proprio ambito e calcolare alcuni parametri che come predetto potranno essere utilizzati come input per il simulatore La teoria ed il funzionamento di tali algoritmi dettagliatamente illustrata nel capitolo 4 La parte successiva affrontata nel capitolo 5 della Tesi riguarda l imple mentazione vera e propria di tali algoritmi mediante l utilizzo dell ambiente di sviluppo Visual Studio 2005 della Microsoft e del linguaggio di programmazione Visual C Inoltre si realizzata un adeguata interfaccia utente attraverso la quale possibile dispor re agevolmente di tutte le funzionalit aggiunte al software Atleta Sono esposte infine le caratteristiche le scelte progettuali effettuate l organizzazione delle classi implementate i diagrammi dei casi d uso ed i diagrammi di sequenza propri del progetto di ingegneria del software L ultimo capitolo 6 riporta le conclusioni sul lavoro svolto la descrizione dello stato attuale del progetto e le ipotesi sugli sviluppi futuri VII 1 2 Descrizione del sistema esistente Il seguente schema illustra le connessioni esistenti tra gli elementi
162. with hst extension or with the new versions tcx one e SUUNTO heart monitors use sdf extension 26 2 4 Project description At the present time the Atleta software is not able to take on data directly from devices but the companies software have the feature to export their own logs in XML format 7 So Atleta can import POLAR SUUNTO and GARMIN logs thanks to its implemented parsers It is very important to note that each software has its own XML format Parsers are used to transform data from each XML file type to a standard XML file used by Atleta This is an important feature of the software that reflects the aforesaid project s guidelines in terms of using standard formal file for every producer Further more each XML file is different from the other one in terms of e kind of stored data e number of stored data e structural schema e precision degree of measurement e variable s names e meaning of variable s names It involves that is essential having an XML structured file equal for all devices More over it must contain the same information The facts just described represent a future works for Atleta developers because one of the project s guideline is to achieve the independency between the software and the utilized training computer So at the moment to import a log is necessary to follow these steps 1 transfer data from device to PC using its own company software 2 export the sele
163. y parameters study determination of relationship between different parameters initial simulation model construction determination of Variables determination of Hypothesis determination of Paradigms Models implementation tests validation verification accreditation At the moment considering this work s contribution Atleta project is at the end of the first phase infrastructure creation In the next page it is possible to see the general Gantt diagram of the project 2 Existing project 1er trimestre 1ertrimestre 1ertrimestre 1er trimestre 1er trimestre 1er trimestre tertrimestre ter tr PERA MA AA ee ee See ee ECA Es PROJECT ATLETA P 1216 days INFRASTRUCTURE CREATION Commercial software study 564 days Software requirements Software implementation 105 days Parser analysis and implementation Statistical data analysis structure Web access study and implementation 218 days DATA RETRIEVAL Retrieval data phase Validation data procedure DATA ANALYSIS Work requirements Statistical data study Simulation model construction 390 days 3 216 days 261 days Tests 173 days General Gantt diagram Figure 2 1 2 2 Current situation 2 2 Current situation The initial part of the present thesis is focused on the study and the analysis of the ex isting system Making reference to the planning phases of th
164. za cardiaca Il valore dello sforzo fisico tipicamente compreso tra 50 e 400 mentre il valore del coefficiente sportivo oscilla tra 0 8 e 1 3 Per quanto concerne l implementazione il software utilizza l algoritmo per visua lizzare graficamente il valore dello sforzo fisico di un atleta consentendo all utente di XXI scegliere la finestra temporale mensile o settimanale Per ciascun allenamento sono mo strati inoltre importanti parametri associati quali i valori minimo massimo e medio sia della frequenza cardiaca che della velocit Il coefficiente sportivo e quello di sforzo relativo a ciascun intervallo di frequenza possono essere modificati a piacere dall utente in tal caso il software ricalcoler nuovamente tutti i parametri 1 5 Algoritmo di analisi della pendenza del tracciato Un altra analisi molto interessante riguarda le prestazioni degli atleti in relazione allo sviluppo altimetrico della corsa Gli atleti possono avere un comportamento molto diffe rente in termini di velocit o consumo energetico a seconda della pendenza del tracciato Per esempio alcuni corridori potrebbero presentare caratteristiche di grande resistenza in salita ma possedere una tecnica di corsa in discesa non efficace Analizzando il profilo del percorso in relazione ai parametri biologici degli atleti possibile evidenziare limiti fisici o atletici in maniera tale da poter adeguatamente pianificare allenamenti che suppliscano a tali carenze
165. zo fisico e tempo di recupero La figura precedente mostra per esempio che con un valore di sforzo pari a 300 la relativa fase di recupero deve esse circa un giorno Terminata questa fase l atleta pronto per compiere un nuovo allenamento poich il suo fisico si trova nella fase di supercompensazione Come anticipato in precedenza il calcolo numerico dello sforzo fisico il risultato della combinazione di tre elementi dell allenamento 1 durata tempo espresso in minuti 2 intensit frequenza cardiaca espressa in battiti al minuto 3 coefficiente sportivo coefficiente che dipende dallo sport praticato XX Per ciascun intervallo di frequenza cardiaca dato un coefficiente di sforzo per il quale moltiplicato il tempo trascorso in tale intervallo Il tutto poi moltiplicato per il coefficiente relativo allo sport praticato La formula la seguente n Sforzo Y CS dell intervallo di frequenza tempotrascorso CS 1 1 i 0 dove CS il Coefficiente di Sforzo C S il Coefficiente Sportivo e e l indice degli intervalli di frequenza cardiaca n il numero degli intervalli di frequenza cardiaca Il coefficiente di sforzo relativo a ciascun intervallo di frequenza stato ricavato in relazione al seguente grafico 10 8 Relative 6 exertion y 2 A XK 0 100 120 110 160 180 200 Heart rate beats min Figura 1 6 Sforzo relativo in funzione della frequen

Download Pdf Manuals

image

Related Search

Related Contents

Fujitsu ESPRIMO E7935  Samsung Galaxy A7 用戶手冊  InLine Mountable Double-Head Ties  eRecruitment Recruiter User Manual  Samsung WD70J5413AW/SC 用户手册  icai student registration portal user manual for students  BEDIENUNGSANLEITUNG  Lab - Troubleshooting DHCPv6  MODE D`EMPLOI  重機土工における最適作業機能と 操作制御方法の選択と課題  

Copyright © All rights reserved.
Failed to retrieve file