test_class.declarator: logger = LoggerFactory.getLogger(DiffusionTest.class)
test_class.modifier: private static final
test_class.original_string: private static final Logger logger = LoggerFactory.getLogger(DiffusionTest.class);
test_class.type: Logger
test_class.var_name: logger
test_class.declarator: systemExtend = Quantities.getQuantity(2500.0, NANO(METRE))
test_class.modifier: private static final
test_class.original_string: private static final Quantity<Length> systemExtend = Quantities.getQuantity(2500.0, NANO(METRE));
test_class.type: Quantity<Length>
test_class.var_name: systemExtend
test_class.declarator: simulationExtend = 2500
test_class.modifier: private static final
test_class.original_string: private static final double simulationExtend = 2500;
test_class.type: double
test_class.var_name: simulationExtend
test_class.declarator: hydrogen = SimpleEntity.create("h2")
              .assignFeature(ConcentrationDiffusivity.of(4.40E-05, SQUARE_CENTIMETRE_PER_SECOND).build())
              .small()
              .build()
test_class.modifier: private static final
test_class.original_string: private static final SimpleEntity hydrogen = SimpleEntity.create("h2")
              .assignFeature(ConcentrationDiffusivity.of(4.40E-05, SQUARE_CENTIMETRE_PER_SECOND).build())
              .small()
              .build();
test_class.type: SimpleEntity
test_class.var_name: hydrogen
test_class.declarator: ammonia = SimpleEntity.create("ammonia")
              .assignFeature(ConcentrationDiffusivity.of(2.28E-05, SQUARE_CENTIMETRE_PER_SECOND).build())
              .small()
              .build()
test_class.modifier: private static final
test_class.original_string: private static final SimpleEntity ammonia = SimpleEntity.create("ammonia")
              .assignFeature(ConcentrationDiffusivity.of(2.28E-05, SQUARE_CENTIMETRE_PER_SECOND).build())
              .small()
              .build();
test_class.type: SimpleEntity
test_class.var_name: ammonia
test_class.declarator: benzene = SimpleEntity.create("benzene")
              .assignFeature(ConcentrationDiffusivity.of(1.09E-05, SQUARE_CENTIMETRE_PER_SECOND).build())
              .small()
              .build()
test_class.modifier: private static final
test_class.original_string: private static final SimpleEntity benzene = SimpleEntity.create("benzene")
              .assignFeature(ConcentrationDiffusivity.of(1.09E-05, SQUARE_CENTIMETRE_PER_SECOND).build())
              .small()
              .build();
test_class.type: SimpleEntity
test_class.var_name: benzene
test_class.file: singa-simulation/src/test/java/bio/singa/simulation/model/modules/concentration/imlementations/transport/DiffusionTest.java
test_class.identifier: DiffusionTest
test_case.body: @Test
      @DisplayName("diffusion of ammonia blocked by membrane")
      void shouldBlockDiffusionWithMembrane() {
  
          // 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, CellRegions.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);
  
          // set concentration
          ConcentrationBuilder.create(simulation)
                  .entity(ammonia)
                  .subsection(CYTOPLASM)
                  .concentrationValue(1.0)
                  .unit(MOLE_PER_LITRE)
                  .updatableIdentifier("n(5,0)")
                  .build();
  
          Diffusion.inSimulation(simulation)
                  .forEntity(ammonia)
                  .forAllSections()
                  .build();
  
          for (int i = 0; i < 10; i++) {
              simulation.nextEpoch();
          }
  
          for (AutomatonNode node : graph.getNodes()) {
              if (node.getIdentifier().getRow() == 1) {
                  // nothing should permeate to the outer part
                  assertEquals(0.0, node.getConcentrationContainer().get(EXTRACELLULAR_REGION, ammonia));
              } else {
                  assertTrue(node.getConcentrationContainer().get(CYTOPLASM, ammonia) > 0.0);
              }
          }
  
      }
test_case.class_method_signature: DiffusionTest.shouldBlockDiffusionWithMembrane()
test_case.full_signature: @Test @DisplayName("diffusion of ammonia blocked by membrane") void shouldBlockDiffusionWithMembrane()
test_case.identifier: shouldBlockDiffusionWithMembrane
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 updatableIdentifier unit concentrationValue subsection entity create build forAllSections forEntity inSimulation nextEpoch getNodes getRow getIdentifier assertEquals get getConcentrationContainer assertTrue get getConcentrationContainer
test_case.modifiers: @Test @DisplayName("diffusion of ammonia blocked by membrane")
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldBlockDiffusionWithMembrane()
focal_class.declarator: logger = LoggerFactory.getLogger(Diffusion.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(Diffusion.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.file: singa-simulation/src/main/java/bio/singa/simulation/model/modules/concentration/imlementations/transport/Diffusion.java
focal_class.identifier: Diffusion
focal_class.class_method_signature: Diffusion.Diffusion()
focal_class.full_signature: public  Diffusion()
focal_class.identifier: Diffusion
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  Diffusion()
focal_class.class_method_signature: Diffusion.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: Diffusion.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: Diffusion.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: Diffusion.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: Diffusion.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: Diffusion.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: Diffusion.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.class_method_signature: Diffusion.inBetweenHalfSteps()
focal_class.full_signature: @Override public void inBetweenHalfSteps()
focal_class.identifier: inBetweenHalfSteps
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void inBetweenHalfSteps()
focal_class.superclass: extends ConcentrationBasedModule<EntityDeltaFunction>
focal_method.body: public static EntityLimitationStep inSimulation(Simulation simulation) {
          return new DiffusionBuilder(simulation);
      }
focal_method.class_method_signature: Diffusion.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)