Skip to content
Snippets Groups Projects
Commit 12b6c1a0 authored by LABOUREL Arnaud's avatar LABOUREL Arnaud
Browse files

separation regulated gene and regulated gene

parent 74a070ae
No related branches found
No related tags found
No related merge requests found
Pipeline #22221 passed
...@@ -2,13 +2,13 @@ package model.genes; ...@@ -2,13 +2,13 @@ package model.genes;
import model.regulators.Regulator; import model.regulators.Regulator;
public class ConstantRegulatedGene implements Gene { public class ConstantGene implements Gene {
private double proteinConcentration; private double proteinConcentration;
private final double initialProteinConcentration; private final double initialProteinConcentration;
private final String name; private final String name;
private boolean isSignaled; private boolean isSignaled;
public ConstantRegulatedGene(String name, double proteinConcentration, boolean isSignaled) { public ConstantGene(String name, double proteinConcentration, boolean isSignaled) {
this.proteinConcentration = proteinConcentration; this.proteinConcentration = proteinConcentration;
this.initialProteinConcentration = proteinConcentration; this.initialProteinConcentration = proteinConcentration;
this.name = name; this.name = name;
......
package model.network; package model.network;
import model.events.SimulationEvent; import model.events.SimulationEvent;
import model.genes.ConstantRegulatedGene; import model.genes.ConstantGene;
import model.genes.Gene; import model.genes.Gene;
import java.io.BufferedReader; import java.io.BufferedReader;
...@@ -73,16 +73,16 @@ public class RegulatoryNetworkDataManager { ...@@ -73,16 +73,16 @@ public class RegulatoryNetworkDataManager {
String name = tokens[1]; String name = tokens[1];
double concentration = Double.parseDouble(tokens[2]); double concentration = Double.parseDouble(tokens[2]);
boolean isSignaled = Boolean.parseBoolean(tokens[3]); boolean isSignaled = Boolean.parseBoolean(tokens[3]);
genes.put(name, new ConstantRegulatedGene(name, concentration, isSignaled)); genes.put(name, new ConstantGene(name, concentration, isSignaled));
} }
public RegulatoryNetwork generate() { public RegulatoryNetwork generate() {
List<Gene> genes = new ArrayList<>(); List<Gene> genes = new ArrayList<>();
Gene x = new ConstantRegulatedGene("X", 3, true); Gene x = new ConstantGene("X", 3, true);
genes.add(x); genes.add(x);
Gene y = new ConstantRegulatedGene("Y", 2, true); Gene y = new ConstantGene("Y", 2, true);
genes.add(y); genes.add(y);
Gene z = new ConstantRegulatedGene("Z", 4, false); Gene z = new ConstantGene("Z", 4, false);
genes.add(z); genes.add(z);
List<SimulationEvent> simulationEvents = new ArrayList<>(); List<SimulationEvent> simulationEvents = new ArrayList<>();
return new RegulatoryNetwork(genes, simulationEvents, 0.01, 20); return new RegulatoryNetwork(genes, simulationEvents, 0.01, 20);
......
...@@ -5,18 +5,18 @@ import org.junit.jupiter.api.Test; ...@@ -5,18 +5,18 @@ import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.*; import static org.assertj.core.api.Assertions.*;
public class ConstantRegulatedGeneTest { public class ConstantGeneTest {
public static final double EPSILON = 0.0000001; public static final double EPSILON = 0.0000001;
private ConstantRegulatedGene geneX; private ConstantGene geneX;
private ConstantRegulatedGene geneY; private ConstantGene geneY;
private ConstantRegulatedGene geneZ; private ConstantGene geneZ;
@BeforeEach @BeforeEach
void initializeGenes(){ void initializeGenes(){
geneX = new ConstantRegulatedGene("X", 1, true); geneX = new ConstantGene("X", 1, true);
geneY = new ConstantRegulatedGene("Y", 2, false); geneY = new ConstantGene("Y", 2, false);
geneZ = new ConstantRegulatedGene("Z", 3, false); geneZ = new ConstantGene("Z", 3, false);
} }
@Test @Test
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment