From 33fa9df1338c0217f842f7b2f9ac0894283c6b10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20F=C3=A9lix?= <felixantoine67@yahoo.fr> Date: Thu, 2 Apr 2020 15:54:07 +0200 Subject: [PATCH] Mise au point des formules de calcul de l'effort. --- .../InterfaceInfoEleve.Designer.cs | 8 ++--- psychorientation/psychorientation/eleve.cs | 34 ++++++------------- 2 files changed, 14 insertions(+), 28 deletions(-) diff --git a/psychorientation/psychorientation/InterfaceInfoEleve.Designer.cs b/psychorientation/psychorientation/InterfaceInfoEleve.Designer.cs index 555fb41..f2239b2 100644 --- a/psychorientation/psychorientation/InterfaceInfoEleve.Designer.cs +++ b/psychorientation/psychorientation/InterfaceInfoEleve.Designer.cs @@ -127,7 +127,7 @@ // // pnlCompetence // - this.pnlCompetence.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0))))); + this.pnlCompetence.BackColor = System.Drawing.Color.Blue; this.pnlCompetence.Location = new System.Drawing.Point(3, 4); this.pnlCompetence.Name = "pnlCompetence"; this.pnlCompetence.Size = new System.Drawing.Size(58, 18); @@ -155,15 +155,15 @@ this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(3, 189); this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(98, 13); + this.label4.Size = new System.Drawing.Size(104, 13); this.label4.TabIndex = 9; - this.label4.Text = "Moyenne général : "; + this.label4.Text = "Moyenne générale : "; this.label4.Click += new System.EventHandler(this.InterfaceInfoEleve_Click); // // lblMoyenne // this.lblMoyenne.AutoSize = true; - this.lblMoyenne.Location = new System.Drawing.Point(96, 189); + this.lblMoyenne.Location = new System.Drawing.Point(107, 189); this.lblMoyenne.Name = "lblMoyenne"; this.lblMoyenne.Size = new System.Drawing.Size(35, 13); this.lblMoyenne.TabIndex = 10; diff --git a/psychorientation/psychorientation/eleve.cs b/psychorientation/psychorientation/eleve.cs index ce8c559..a2d382c 100644 --- a/psychorientation/psychorientation/eleve.cs +++ b/psychorientation/psychorientation/eleve.cs @@ -106,18 +106,17 @@ namespace psychorientation public void Progression(double typeEducation) { - double t_competence = competence; - this.competence += this.effort * 0.1 * (1 - (t_competence * 0.1)) * (1.0 / 12); - - if (competence < 0) { competence = 0; } - else if (competence > 10) { competence = 10; } - - if (t_competence != typeEducation) - this.effort += Math.Min(Math.Max(((1 / Math.Abs(t_competence - typeEducation)) - (1.0 / 3)) * 3, -1), 1) * 1; + if (competence != typeEducation) + this.effort += Math.Min(Math.Max(((1 / Math.Abs(competence - typeEducation)) - (1.0 / 3)) * 3, -1), 1); else - this.effort += 0.5; + this.effort += 1; if (effort < 0) { effort = 0; } else if (effort > 10) { effort = 10; } + + this.competence += (((effort * 0.1) - 0.3) * (1.2 - (competence * 0.1))); + + if (competence < 0) { competence = 0; } + else if (competence > 10) { competence = 10; } } @@ -126,7 +125,6 @@ namespace psychorientation double note = CalculerNote(); double note_convenable = 10 + (competence - 5); - /* if (effort > 5) { if (note >= note_convenable) @@ -146,25 +144,13 @@ namespace psychorientation } else { - if (competence > 5) - { - effort += 0.25; - } - else - { - effort -= 0.25; - } + effort += 0.25; } - }*/ - /* - if (note_convenable <= note) - { - this.effort -= 0.5*this.competence*0.3; } if (effort < 0) { effort = 0; } else if (effort > 10) { effort = 10; } - */ + Note n = new Note(nom, note, this.competence, this.effort); this.listeNotes.Add(n); } -- GitLab