test_class.file: singa-simulation/src/test/java/bio/singa/simulation/model/modules/concentration/imlementations/transport/LateralMembraneDiffusionTest.java
test_class.identifier: LateralMembraneDiffusionTest
test_case.body: @Test
      @DisplayName("lateral diffusion in membranes")
      void shouldDiffuseInMembrane() {
  
          // create simulation
          Simulation simulation = new Simulation();
  
          GridImageReader imageReader = GridImageReader.readTemplate(Resources.getResourceAsFileLocation("grids/membrane_10x2.png"));
          int[][] sectionArray = imageReader.getGrid();
  
          Environment.setSimulationExtend(1000);
          ComparableQuantity<Length> systemExtend = Quantities.getQuantity(1000, NANO(METRE));
          Environment.setSystemExtend(systemExtend);
          Environment.setNodeSpacingToDiameter(systemExtend, 10);
  
          GridMembraneBuilder gmb = new GridMembraneBuilder(sectionArray);
          int red = Color.RED.getRGB();
          int blue = Color.BLUE.getRGB();
          Map<Integer, CellRegion> subsectionMap = new HashMap<>();
          subsectionMap.put(red, CYTOPLASM_REGION);
          subsectionMap.put(blue, EXTRACELLULAR_REGION);
  
          Map<Pair<Integer>, CellRegion> membraneMap = new HashMap<>();
          membraneMap.put(new Pair<>(blue, red), CELL_OUTER_MEMBRANE_REGION);
          membraneMap.put(new Pair<>(red, blue), CELL_INNER_MEMBRANE_REGION);
  
          gmb.setRegionMapping(subsectionMap);
          gmb.setMembraneMapping(membraneMap);
          gmb.createTopology();
  
          AutomatonGraph graph = gmb.getGraph();
          simulation.setGraph(graph);
          MembraneLayer membraneLayer = new MembraneLayer();
          Membrane membrane = gmb.getMembranes().get(CELL_OUTER_MEMBRANE_REGION);
          membraneLayer.addMembrane(membrane);
          simulation.setMembraneLayer(membraneLayer);
  
          simulation.setGraph(graph);
  
          ChemicalEntity lacz = SimpleEntity.create("LacZ")
                  .assignFeature(Radius
                          .of(3.0, NANO(METRE))
                          .build())
                  .build();
  
          // set concentrations
          ConcentrationBuilder.create(simulation)
                  .entity(lacz)
                  .topology(MEMBRANE)
                  .concentrationValue(10)
                  .microMolar()
                  .updatableIdentifier("n(5,1)")
                  .build();
  
          LateralMembraneDiffusion.inSimulation(simulation)
                  .forEntity(lacz)
                  .forMembrane(CELL_OUTER_MEMBRANE_REGION)
                  .build();
  
          AutomatonNode node = simulation.getGraph().getNode(5, 1);
          double previousConcentration = UnitRegistry.concentration(10, MICRO_MOLE_PER_LITRE).getValue().doubleValue();
          for (int i = 0; i < 10; i++) {
              simulation.nextEpoch();
              double currentConcentration = node.getConcentrationContainer().get(MEMBRANE, lacz);
              assertTrue(currentConcentration < previousConcentration);
          }
  
      }
test_case.class_method_signature: LateralMembraneDiffusionTest.shouldDiffuseInMembrane()
test_case.full_signature: @Test @DisplayName("lateral diffusion in membranes") void shouldDiffuseInMembrane()
test_case.identifier: shouldDiffuseInMembrane
test_case.invocations: readTemplate getResourceAsFileLocation getGrid setSimulationExtend getQuantity NANO setSystemExtend setNodeSpacingToDiameter getRGB getRGB put put put put setRegionMapping setMembraneMapping createTopology getGraph setGraph get getMembranes addMembrane setMembraneLayer setGraph build assignFeature create build of NANO build updatableIdentifier microMolar concentrationValue topology entity create build forMembrane forEntity inSimulation getNode getGraph doubleValue getValue concentration nextEpoch get getConcentrationContainer assertTrue
test_case.modifiers: @Test @DisplayName("lateral diffusion in membranes")
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldDiffuseInMembrane()
focal_class.declarator: logger = LoggerFactory.getLogger(LateralMembraneDiffusion.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(LateralMembraneDiffusion.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: restrictedRegion
focal_class.modifier: private
focal_class.original_string: private CellRegion restrictedRegion;
focal_class.type: CellRegion
focal_class.var_name: restrictedRegion
focal_class.file: singa-simulation/src/main/java/bio/singa/simulation/model/modules/concentration/imlementations/transport/LateralMembraneDiffusion.java
focal_class.identifier: LateralMembraneDiffusion
focal_class.class_method_signature: LateralMembraneDiffusion.LateralMembraneDiffusion()
focal_class.full_signature: public  LateralMembraneDiffusion()
focal_class.identifier: LateralMembraneDiffusion
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  LateralMembraneDiffusion()
focal_class.class_method_signature: LateralMembraneDiffusion.inSimulation(Simulation simulation)
focal_class.full_signature: public static EntityLimitationStep inSimulation(Simulation simulation)
focal_class.identifier: inSimulation
focal_class.modifiers: public static
focal_class.parameters: (Simulation simulation)
focal_class.return: EntityLimitationStep
focal_class.signature: EntityLimitationStep inSimulation(Simulation simulation)
focal_class.class_method_signature: LateralMembraneDiffusion.getBuilder(Simulation simulation)
focal_class.full_signature: public static ModuleBuilder getBuilder(Simulation simulation)
focal_class.identifier: getBuilder
focal_class.modifiers: public static
focal_class.parameters: (Simulation simulation)
focal_class.return: ModuleBuilder
focal_class.signature: ModuleBuilder getBuilder(Simulation simulation)
focal_class.class_method_signature: LateralMembraneDiffusion.postConstruct()
focal_class.full_signature: private void postConstruct()
focal_class.identifier: postConstruct
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void postConstruct()
focal_class.class_method_signature: LateralMembraneDiffusion.hasMembrane(Updatable updatable)
focal_class.full_signature: private boolean hasMembrane(Updatable updatable)
focal_class.identifier: hasMembrane
focal_class.modifiers: private
focal_class.parameters: (Updatable updatable)
focal_class.return: boolean
focal_class.signature: boolean hasMembrane(Updatable updatable)
focal_class.class_method_signature: LateralMembraneDiffusion.unrestrictedApplication(ConcentrationContainer container)
focal_class.full_signature: private boolean unrestrictedApplication(ConcentrationContainer container)
focal_class.identifier: unrestrictedApplication
focal_class.modifiers: private
focal_class.parameters: (ConcentrationContainer container)
focal_class.return: boolean
focal_class.signature: boolean unrestrictedApplication(ConcentrationContainer container)
focal_class.class_method_signature: LateralMembraneDiffusion.restrictedApplication(ConcentrationContainer container)
focal_class.full_signature: private boolean restrictedApplication(ConcentrationContainer container)
focal_class.identifier: restrictedApplication
focal_class.modifiers: private
focal_class.parameters: (ConcentrationContainer container)
focal_class.return: boolean
focal_class.signature: boolean restrictedApplication(ConcentrationContainer container)
focal_class.class_method_signature: LateralMembraneDiffusion.calculateDelta(ConcentrationContainer concentrationContainer)
focal_class.full_signature: private ConcentrationDelta calculateDelta(ConcentrationContainer concentrationContainer)
focal_class.identifier: calculateDelta
focal_class.modifiers: private
focal_class.parameters: (ConcentrationContainer concentrationContainer)
focal_class.return: ConcentrationDelta
focal_class.signature: ConcentrationDelta calculateDelta(ConcentrationContainer concentrationContainer)
focal_class.class_method_signature: LateralMembraneDiffusion.checkFeatures()
focal_class.full_signature: @Override public void checkFeatures()
focal_class.identifier: checkFeatures
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void checkFeatures()
focal_class.superclass: extends ConcentrationBasedModule<EntityDeltaFunction>
focal_method.body: public static EntityLimitationStep inSimulation(Simulation simulation) {
          return new LateralMembraneDiffusionBuilder(simulation);
      }
focal_method.class_method_signature: LateralMembraneDiffusion.inSimulation(Simulation simulation)
focal_method.full_signature: public static EntityLimitationStep inSimulation(Simulation simulation)
focal_method.identifier: inSimulation
focal_method.modifiers: public static
focal_method.parameters: (Simulation simulation)
focal_method.return: EntityLimitationStep
focal_method.signature: EntityLimitationStep inSimulation(Simulation simulation)