diff --git a/psychorientation/psychorientation/Config.cs b/psychorientation/psychorientation/Config.cs deleted file mode 100644 index cb21581e0dc163f6ef9645c35161b0a9eb1f406f..0000000000000000000000000000000000000000 --- a/psychorientation/psychorientation/Config.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.IO; -using System.Threading.Tasks; -using Newtonsoft.Json; - -namespace psychorientation -{ - class Config - { - private static Config instance; - - public double coeffEffortOral; - public double coeffCompetenceOral; - - public double coeffCompetenceEcrit; - public double coeffEffortEcrit; - - public static Config GetInstance() - { - if (Config.instance == null) - { - - Config.instance = JsonConvert.DeserializeObject<Config>(File.ReadAllText("config.json")); - return Config.instance; - } - else - { - return Config.instance; - } - } - - public double GetCoeffEffortOral() - { - return this.coeffEffortOral; - } - - public double GetCoeffCompetenceOral() - { - return this.coeffCompetenceOral; - } - - public double GetCoeffCompetenceEcrit() - { - return this.coeffCompetenceEcrit; - } - - public double GetCoeffEffortEcrit() - { - return this.coeffEffortEcrit; - } - } -} diff --git a/psychorientation/psychorientation/eleve.cs b/psychorientation/psychorientation/eleve.cs index 60bf56814a4e5de2b350d993109e107b324ccfaf..0e5dfb4b38d3d12d044ba7054983cb2bd7201c31 100644 --- a/psychorientation/psychorientation/eleve.cs +++ b/psychorientation/psychorientation/eleve.cs @@ -25,7 +25,7 @@ namespace psychorientation this.competence = Eleve.r.NextDouble()*10; this.effort = Eleve.r.NextDouble()*10; this.orientation = 0; - this.appreciation=CalculerAppreciation(); + this.appreciation=CalculerAppreciation(1); } public Eleve(int id,int classe, double competence, double effort, int orientation) @@ -35,7 +35,7 @@ namespace psychorientation this.competence = competence; this.effort = effort; this.orientation = orientation; - this.appreciation = CalculerAppreciation(); + this.appreciation = CalculerAppreciation(1); } public void SetClasse(int classe) { @@ -161,9 +161,9 @@ namespace psychorientation return (this.effort * (2 - coeff) + this.competence * coeff); } - private double CalculerAppreciation() + private double CalculerAppreciation(double coeff) { - return (this.effort * Config.GetInstance().GetCoeffEffortOral() + this.competence * Config.GetInstance().GetCoeffCompetenceOral()); + return (this.effort * (2 - coeff) + this.competence * coeff); } } } diff --git a/psychorientation/psychorientation/psychorientation.csproj b/psychorientation/psychorientation/psychorientation.csproj index b1e0e2056905395f103fdb6a10f041f2d1de6568..a24c009ff7f1e1784e2b2bce8f18f4a7e8938837 100644 --- a/psychorientation/psychorientation/psychorientation.csproj +++ b/psychorientation/psychorientation/psychorientation.csproj @@ -50,7 +50,6 @@ <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> - <Compile Include="Config.cs" /> <Compile Include="Eleve.cs" /> <Compile Include="InterfaceClasse.cs"> <SubType>Form</SubType>