Templates

List of available templates for creating new components.


SYSTEM

 1# Template for the SYSTEM component.
 2# This template is used to create the SYSTEM component.
 3# Comments begin with a hash (#) and they can be removed.
 4
 5import sys, os
 6import logging
 7from . import systemBase
 8
 9class __SYSTEM_TEMPLATE__(systemBase):
10    """
11    {"author": "__AUTHOR__",
12     "description":
13     "Brief description of what this system component does and its purpose in the simulation.
14      Explain how it affects the overall simulation setup, any global properties it defines,
15      and when it should be used. Provide any relevant background information here.
16      You can use multiple lines for clarity.",
17     "parameters":{
18        "param1":{"description":"Description of parameter 1",
19                  "type":"type of param1 (e.g., float, int, str)",
20                  "default":null},
21        "param2":{"description":"Description of parameter 2",
22                  "type":"type of param2",
23                  "default":null},
24        "param3":{"description":"Description of optional parameter 3",
25                  "type":"type of param3",
26                  "default":"default_value"}
27     },
28     "example":"
29         {
30            \"type\":\"__SYSTEM_TEMPLATE__\",
31            \"parameters\":{
32                \"param1\":value1,
33                \"param2\":value2,
34                \"param3\":value3
35            }
36         }
37        "
38    }
39    """
40
41    availableParameters = {"param1", "param2", "param3"}
42    requiredParameters  = {"param1", "param2"}
43
44    def __init__(self, name, **params):
45        super().__init__(_type = self.__class__.__name__,
46                         _name = name,
47                         availableParameters = self.availableParameters,
48                         requiredParameters  = self.requiredParameters,
49                         **params)
50
51        # Access logger if needed
52        # self.logger.info("Initializing __SYSTEM_TEMPLATE__")
53
54        # Read parameters
55        param1 = params["param1"]
56        param2 = params["param2"]
57        param3 = params.get("param3", "default_value")
58
59        # Process parameters if necessary
60        # processed_param = some_function(param1, param2)
61
62        # Generate the system configuration using UAMMD-structured format
63        system = {
64            name: {
65                "type": ["System", "__SYSTEM_TEMPLATE__"],  # UAMMD-structured type
66                "parameters": {  # UAMMD-structured parameters
67                    "param1": param1,
68                    "param2": param2,
69                    "param3": param3
70                }
71            }
72        }
73
74        # Set the system configuration
75        self.setSystem(system)
76
77        # Log completion if needed
78        # self.logger.info("__SYSTEM_TEMPLATE__ initialized successfully")

UNITS

 1import sys, os
 2import logging
 3from . import unitsBase
 4
 5class __UNITS_TEMPLATE__(unitsBase):
 6    """
 7    {
 8    "author": "__AUTHOR__",
 9    "description": "Brief description of this unit system and its application in the simulation.",
10    "parameters": {
11        "customConstant1": {"description": "Description of custom constant 1",
12                            "type": "float",
13                            "default": 1.0},
14        "customConstant2": {"description": "Description of custom constant 2",
15                            "type": "float",
16                            "default": 1.0}
17    },
18    "example": "
19    {
20        \"type\": \"__UNITS_TEMPLATE__\",
21        \"parameters\": {
22            \"customConstant1\": 2.5,
23            \"customConstant2\": 3.14
24        }
25    }
26    "
27    }
28    """
29
30    availableParameters = {"customConstant1", "customConstant2"}
31    requiredParameters = set()  # All parameters are optional in this example
32
33    def __init__(self, name, **params):
34        super().__init__(_type=self.__class__.__name__,
35                         _name=name,
36                         availableParameters=self.availableParameters,
37                         requiredParameters=self.requiredParameters,
38                         **params)
39
40        ############################################################
41        # Access and process parameters
42        ############################################################
43
44        customConstant1 = params.get("customConstant1", 1.0)
45        customConstant2 = params.get("customConstant2", 1.0)
46
47        ############################################################
48        # Set up units
49        ############################################################
50
51        # Set the name of this unit system
52        self.setUnitsName("CustomUnits")
53
54        # Add standard constants
55        self.addConstant("KBOLTZ", 1.380649e-23)  # Boltzmann constant in SI units
56        self.addConstant("ELECOEF", 8.9875517923e9)  # Coulomb's constant in SI units
57
58        # Add custom constants
59        self.addConstant("CUSTOM1", customConstant1)
60        self.addConstant("CUSTOM2", customConstant2)
61
62        ############################################################
63        # Log units setup
64        ############################################################
65
66        self.logger.info(f"Initialized {name} units with {len(self._constants)} constants")

TYPES

 1import sys, os
 2import logging
 3from . import typesBase
 4
 5class __TYPES_TEMPLATE__(typesBase):
 6    """
 7    {
 8    "author": "__AUTHOR__",
 9    "description": "Brief description of what these types represent in the simulation.",
10    "parameters": {
11        "defaultMass": {"description": "Default mass for new types",
12                        "type": "float",
13                        "default": 1.0},
14        "defaultRadius": {"description": "Default radius for new types",
15                          "type": "float",
16                          "default": 0.5},
17        "param1": {"description": "Description of additional parameter 1",
18                   "type": "type of param1"},
19        "param2": {"description": "Description of additional parameter 2",
20                   "type": "type of param2"}
21    },
22    "example": "
23    {
24        \"type\": \"__TYPES_TEMPLATE__\",
25        \"parameters\": {
26            \"defaultMass\": 2.0,
27            \"defaultRadius\": 0.75,
28            \"param1\": value1,
29            \"param2\": value2
30        }
31    }
32    "
33    }
34    """
35
36    availableParameters = {"defaultMass", "defaultRadius", "param1", "param2"}
37    requiredParameters = set()  # All parameters are optional in this example
38
39    def __init__(self, name, **params):
40        super().__init__(_type=self.__class__.__name__,
41                         _name=name,
42                         availableParameters=self.availableParameters,
43                         requiredParameters=self.requiredParameters,
44                         **params)
45
46        ############################################################
47        # Access and process parameters
48        ############################################################
49
50        self.defaultMass = params.get("defaultMass", 1.0)
51        self.defaultRadius = params.get("defaultRadius", 0.5)
52        self.param1 = params.get("param1")
53        self.param2 = params.get("param2")
54
55        ############################################################
56        # Set up types
57        ############################################################
58
59        self.setTypesName("CustomTypes")  # Set the name for this set of types
60
61        # Add default components for each type
62        self.addTypesComponent("mass", self.defaultMass)
63        self.addTypesComponent("radius", self.defaultRadius)
64
65        # Add additional components if needed
66        if self.param1 is not None:
67            self.addTypesComponent("param1", self.param1)
68        if self.param2 is not None:
69            self.addTypesComponent("param2", self.param2)
70
71        ############################################################
72        # Define specific types (example)
73        ############################################################
74
75        self.addType(name="TypeA", mass=1.0, radius=0.5)
76        self.addType(name="TypeB", mass=2.0, radius=0.75)
77
78        # If additional parameters were defined, include them in type definitions
79        if self.param1 is not None and self.param2 is not None:
80            self.addType(name="TypeC", mass=1.5, radius=0.6, param1=self.param1, param2=self.param2)
81
82        ############################################################
83        # Log types setup
84        ############################################################
85
86        self.logger.info(f"Initialized {name} types with {len(self.getTypes())} defined types")

ENSEMBLE

 1#Template for the ENSEMBLE component.
 2#This template is used to create the ENSEMBLE component.
 3#Comments begin with a hash (#) and they can be removed.
 4
 5import sys, os
 6import logging
 7from . import ensembleBase
 8
 9class __ENSEMBLE_TEMPLATE__(ensembleBase):
10    """
11    {"author": "__AUTHOR__",
12     "description":
13     "Brief description of what this ensemble does and its purpose in the simulation.
14      Provide any relevant background information or key features here.
15      You can use multiple lines for clarity",
16
17     "parameters":{
18        "param1":{"description":"Description of parameter 1",
19                  "type":"type of param1 (e.g., float, int, str)",
20                  "default":null},
21        "param2":{"description":"Description of parameter 2",
22                  "type":"type of param2",
23                  "default":null},
24        "param3":{"description":"Description of optional parameter 3",
25                  "type":"type of param3",
26                  "default":"default_value"}
27     },
28     "example":"
29         {
30            \"type\":\"__ENSEMBLE_TEMPLATE__\",
31            \"parameters\":{
32                \"param1\":value1,
33                \"param2\":value2,
34                \"param3\":value3
35            }
36         }
37        "
38    }
39    """
40
41    availableParameters = {"param1", "param2", "param3"}
42    requiredParameters  = {"param1", "param2"}
43
44    def __init__(self,name,**params):
45        super().__init__(_type = self.__class__.__name__,
46                         _name = name,
47                         availableParameters = self.availableParameters,
48                         requiredParameters  = self.requiredParameters,
49                         **params)
50
51        ############################################################
52        ############################################################
53        ############################################################
54
55        # Access logger if needed
56        # self.logger.info("Initializing __ENSEMBLE_TEMPLATE__")
57
58        # Read parameters
59        param1 = params["param1"]
60        param2 = params["param2"]
61        param3 = params.get("param3", "default_value")
62
63        # Process parameters if necessary
64        # processed_param = some_function(param1, param2)
65
66        # Set the ensemble name
67        self.setEnsembleName("__ENSEMBLE_TEMPLATE__") # This has to be a UAMMD-structured available ensemble name
68
69        self.addEnsembleComponent("componentName1", value)
70        self.addEnsembleComponent("componentName2", value)
71        # ...
72
73        # Log completion if needed
74        # self.logger.info("__ENSEMBLE_TEMPLATE__ initialized successfully")

MODELS

  1import sys, os
  2import logging
  3import numpy as np
  4from . import modelBase
  5
  6class __MODEL_TEMPLATE__(modelBase):
  7    """
  8    {
  9    "author": "__AUTHOR__",
 10    "description": "Brief description of what this model represents or simulates.",
 11    "parameters": {
 12        "param1": {"description": "Description of parameter 1",
 13                   "type": "type of param1"},
 14        "param2": {"description": "Description of parameter 2",
 15                   "type": "type of param2"},
 16        "param3": {"description": "Description of parameter 3",
 17                   "type": "type of param3",
 18                   "default": "default value if any"}
 19    },
 20    "example": "
 21    {
 22        \"type\": \"__MODEL_TEMPLATE__\",
 23        \"parameters\": {
 24            \"param1\": value1,
 25            \"param2\": value2,
 26            \"param3\": value3
 27        }
 28    }
 29    "
 30    }
 31    """
 32
 33    availableParameters = {"param1", "param2", "param3"}
 34    requiredParameters = {"param1", "param2"}
 35    definedSelections = {"selectionType1", "selectionType2"}  # Types of selections this model can process
 36
 37    def __init__(self, name, **params):
 38        super().__init__(_type=self.__class__.__name__,
 39                         _name=name,
 40                         availableParameters=self.availableParameters,
 41                         requiredParameters=self.requiredParameters,
 42                         definedSelections=self.definedSelections,
 43                         **params)
 44
 45        ############################################################
 46        # Access and process parameters
 47        ############################################################
 48
 49        param1 = params["param1"]
 50        param2 = params["param2"]
 51        param3 = params.get("param3", "default_value")
 52
 53        ############################################################
 54        # Set up model components
 55        ############################################################
 56
 57        # Set up particle types
 58        types = self.getTypes()
 59        types.addType(name="TypeA", mass=1.0, radius=0.5)
 60        types.addType(name="TypeB", mass=2.0, radius=0.7)
 61
 62        # Generate initial state (e.g., positions)
 63        num_particles = 100  # Example number of particles
 64        positions = self._generate_initial_positions(num_particles)
 65
 66        # Set up state
 67        state = {
 68            "labels": ["id", "position"],
 69            "data": [[i, pos] for i, pos in enumerate(positions)]
 70        }
 71        self.setState(state)
 72
 73        # Set up structure
 74        structure = {
 75            "labels": ["id", "type"],
 76            "data": [[i, "TypeA" if i % 2 == 0 else "TypeB"] for i in range(num_particles)]
 77        }
 78        self.setStructure(structure)
 79
 80        # Set up force field
 81        force_field = self._setup_force_field(param1, param2)
 82        self.setForceField(force_field)
 83
 84        ############################################################
 85        # Log model setup
 86        ############################################################
 87
 88        self.logger.info(f"Initialized {name} model with {num_particles} particles")
 89
 90    def _generate_initial_positions(self, num_particles):
 91        # Example: Generate random positions in a cube
 92        return np.random.uniform(-5, 5, (num_particles, 3)).tolist()
 93
 94    def _setup_force_field(self, param1, param2):
 95        # Example: Set up a simple Lennard-Jones potential
 96        force_field = {
 97            "LennardJones": {
 98                "type": ["NonBonded", "LennardJones"],
 99                "parameters": {"epsilon": param1, "sigma": param2},
100                "labels": ["name_i", "name_j", "epsilon", "sigma"],
101                "data": [
102                    ["TypeA", "TypeA", param1, param2],
103                    ["TypeA", "TypeB", param1, param2],
104                    ["TypeB", "TypeB", param1, param2]
105                ]
106            }
107        }
108        return force_field
109
110    def processSelection(self, selectionType, selectionOptions):
111        # Implement selection processing logic here
112        # This method should return a list of particle IDs based on the selection criteria
113        if selectionType == "selectionType1":
114            # Process selectionType1
115            pass
116        elif selectionType == "selectionType2":
117            # Process selectionType2
118            pass
119        return None  # Replace with actual selection logic

MODEL_OPERATIONS

 1import sys, os
 2import logging
 3from . import modelOperationBase
 4
 5class __MODEL_OPERATION_TEMPLATE__(modelOperationBase):
 6    """
 7    {
 8    "author": "__AUTHOR__",
 9    "description": "Short description of what this model operation does.",
10    "parameters": {
11        "param1": {"description": "Description of parameter 1",
12                   "type": "type of param1"},
13        "param2": {"description": "Description of parameter 2",
14                   "type": "type of param2"},
15        "param3": {"description": "Description of parameter 3",
16                   "type": "type of param3",
17                   "default": "default value if any"}
18    },
19    "selections": {
20        "selection1": {"description": "Description of selection 1",
21                       "type": "type of selection1"},
22        "selection2": {"description": "Description of selection 2",
23                       "type": "type of selection2"}
24    },
25    "example": "
26    {
27        \"type\": \"__MODEL_OPERATION_TEMPLATE__\",
28        \"parameters\": {
29            \"param1\": value1,
30            \"param2\": value2,
31            \"selection1\": \"model1 type A\",
32            \"selection2\": \"model2 type B\"
33        }
34    }
35    "
36    }
37    """
38
39    availableParameters = {"param1", "param2", "param3"}
40    requiredParameters = {"param1", "param2"}
41    availableSelections = {"selection1", "selection2"}
42    requiredSelections = {"selection1"}
43
44    def __init__(self, name, **params):
45        super().__init__(_type=self.__class__.__name__,
46                         _name=name,
47                         availableParameters=self.availableParameters,
48                         requiredParameters=self.requiredParameters,
49                         availableSelections=self.availableSelections,
50                         requiredSelections=self.requiredSelections,
51                         **params)
52
53        ############################################################
54        # Access and process parameters
55        ############################################################
56
57        param1 = params["param1"]
58        param2 = params["param2"]
59        param3 = params.get("param3", "default_value")
60
61        # Process selections
62        selection1 = self.getSelection("selection1")
63        selection2 = self.getSelection("selection2") if "selection2" in params else None
64
65        ############################################################
66        # Implement the model operation logic
67        ############################################################
68
69        # Example: Modify positions of selected particles
70        selected_ids = selection1  # Assuming selection1 is the main selection to operate on
71        positions = self.getIdsState(selected_ids, "position")
72
73        # Perform operations on positions...
74        new_positions = [self._process_position(pos, param1, param2) for pos in positions]
75
76        # Update the state with new positions
77        self.setIdsState(selected_ids, "position", new_positions)
78
79        ############################################################
80        # Log the operation
81        ############################################################
82
83        self.logger.info(f"Completed {self._name} operation on {len(selected_ids)} particles")
84
85    def _process_position(self, position, param1, param2):
86        # Example processing function
87        return [p + param1 * param2 for p in position]

MODEL_EXTENSIONS

  1import sys, os
  2import logging
  3from . import modelExtensionBase
  4
  5class __MODEL_EXTENSION_TEMPLATE__(modelExtensionBase):
  6    """
  7    {"author": "__AUTHOR__",
  8     "description":
  9     "Brief description of what this model extension does and its purpose in the simulation.
 10      Explain how it extends or modifies the existing model, its advantages, and when it should be used.
 11      Provide any relevant background information or key features here.
 12      You can use multiple lines for clarity.",
 13     "parameters":{
 14        "param1":{"description":"Description of parameter 1",
 15                  "type":"type of param1 (e.g., float, int, str)",
 16                  "default":null},
 17        "param2":{"description":"Description of parameter 2",
 18                  "type":"type of param2",
 19                  "default":null},
 20        "param3":{"description":"Description of optional parameter 3",
 21                  "type":"type of param3",
 22                  "default":"default_value"}
 23     },
 24     "selections":{
 25        "selection1":{"description":"Description of selection 1",
 26                      "type":"list of ids"},
 27        "selection2":{"description":"Description of optional selection 2",
 28                      "type":"list of ids"}
 29     },
 30     "example":"
 31         {
 32            \"type\":\"__MODEL_EXTENSION_TEMPLATE__\",
 33            \"parameters\":{
 34                \"param1\":value1,
 35                \"param2\":value2,
 36                \"param3\":value3
 37            },
 38            \"selections\":{
 39                \"selection1\":\"model1 type A\",
 40                \"selection2\":\"model2 resid 1 to 10\"
 41            }
 42         }
 43        "
 44    }
 45    """
 46
 47    availableParameters = {"param1", "param2", "param3"}
 48    requiredParameters  = {"param1", "param2"}
 49    availableSelections = {"selection1", "selection2"}
 50    requiredSelections  = {"selection1"}
 51
 52    def __init__(self, name, **params):
 53        super().__init__(_type = self.__class__.__name__,
 54                         _name = name,
 55                         availableParameters = self.availableParameters,
 56                         requiredParameters  = self.requiredParameters,
 57                         availableSelections = self.availableSelections,
 58                         requiredSelections  = self.requiredSelections,
 59                         **params)
 60
 61        ############################################################
 62        ############################################################
 63        ############################################################
 64
 65        # Access logger if needed
 66        # self.logger.info("Initializing __MODEL_EXTENSION_TEMPLATE__")
 67
 68        # Read parameters
 69        param1 = params["param1"]
 70        param2 = params["param2"]
 71        param3 = params.get("param3", "default_value")
 72
 73        # Get selections
 74        selection1 = self.getSelection("selection1")
 75        selection2 = self.getSelection("selection2") if "selection2" in params else None
 76
 77        # Process parameters if necessary
 78        # processed_param = some_function(param1, param2)
 79
 80        # Define the extension dictionary using UAMMD-structured format
 81        extension = {
 82            name: {
 83                "type": ["ModelExtension", "__MODEL_EXTENSION_TEMPLATE__"],  # UAMMD-structured type
 84                "parameters": {  # UAMMD-structured parameters
 85                    "param1": param1,
 86                    "param2": param2,
 87                    "param3": param3
 88                    # Add any other necessary parameters
 89                },
 90                "labels": ["id", "value1", "value2"],  # UAMMD-structured labels
 91                "data": []  # UAMMD-structured data
 92            }
 93        }
 94
 95        # Fill the data based on selections
 96        for id in selection1:
 97            # Example of how to fill data, adjust as needed for your specific extension
 98            extension[name]["data"].append([id, some_value1, some_value2])
 99
100        if selection2:
101            for id in selection2:
102                # Add data for selection2 if it exists
103                extension[name]["data"].append([id, some_other_value1, some_other_value2])
104
105        # You can add more complex logic here if needed
106        # For example, adding conditional parameters or computed values
107
108        # Set the extension
109        self.setExtension(extension)
110
111        # Set group if needed
112        # self.setGroup("selection1")
113
114        # Log completion if needed
115        # self.logger.info("__MODEL_EXTENSION_TEMPLATE__ initialized successfully")

INTEGRATORS

 1import sys, os
 2import logging
 3from . import integratorBase
 4
 5class __INTEGRATORS_TEMPLATE__(integratorBase):
 6    """
 7    {"author": "__AUTHOR__",
 8     "description":
 9     "Brief description of what this integrator does and its purpose in the simulation.
10      Explain the integration method, its advantages, and when it should be used.
11      Provide any relevant background information or key features here.
12      You can use multiple lines for clarity",
13     "parameters":{
14        "integrationSteps":{"description":"Number of integration steps",
15                            "type":"int",
16                            "default":null},
17        "timeStep":{"description":"Time step for integration",
18                    "type":"float",
19                    "default":null},
20        "param1":{"description":"Description of parameter 1",
21                  "type":"type of param1",
22                  "default":null},
23        "param2":{"description":"Description of optional parameter 2",
24                  "type":"type of param2",
25                  "default":"default_value"}
26     },
27     "example":"
28         {
29            \"type\":\"__INTEGRATORS_TEMPLATE__\",
30            \"parameters\":{
31                \"integrationSteps\":1000,
32                \"timeStep\":0.001,
33                \"param1\":value1,
34                \"param2\":value2
35            }
36         }
37        "
38    }
39    """
40
41    availableParameters = {"integrationSteps", "timeStep", "param1", "param2"}
42    requiredParameters  = {"integrationSteps", "timeStep", "param1"}
43
44    def __init__(self,name,**params):
45        super().__init__(_type = self.__class__.__name__,
46                         _name = name,
47                         availableParameters = self.availableParameters,
48                         requiredParameters  = self.requiredParameters,
49                         **params)
50
51        ############################################################
52        ############################################################
53        ############################################################
54
55        # Access logger if needed
56        # self.logger.info("Initializing __INTEGRATORS_TEMPLATE__")
57
58        # Read parameters
59        integrationSteps = params["integrationSteps"]
60        timeStep = params["timeStep"]
61        param1 = params["param1"]
62        param2 = params.get("param2", "default_value")
63
64        # Process parameters if necessary
65        # processed_param = some_function(param1, timeStep)
66
67        # Define the integrator dictionary using UAMMD-structured format
68        integrator = {
69            "type": ["Integrator", "__INTEGRATORS_TEMPLATE__"],  # UAMMD-structured type
70            "parameters": {  # UAMMD-structured parameters
71                "timeStep": timeStep,
72                "param1": param1,
73                "param2": param2
74                # Add any other necessary parameters
75                # Note: integrationSteps is handled separately by UAMMD
76            }
77        }
78
79        # Set the integration steps
80        self.setIntegrationSteps(integrationSteps)
81
82        # Set the integrator
83        self.setIntegrator(integrator)
84
85        # Log completion if needed
86        # self.logger.info("__INTEGRATORS_TEMPLATE__ initialized successfully")

SIMULATION_STEPS

  1import sys, os
  2import logging
  3from . import simulationStepBase
  4
  5class __SIMULATION_STEPS_TEMPLATE__(simulationStepBase):
  6    """
  7    {
  8    "author": "__AUTHOR__",
  9    "description": "Brief description of what this simulation step does.",
 10    "parameters": {
 11        "intervalStep": {"description": "Interval at which this step is executed",
 12                         "type": "int"},
 13        "param1": {"description": "Description of parameter 1",
 14                   "type": "type of param1"},
 15        "param2": {"description": "Description of parameter 2",
 16                   "type": "type of param2"},
 17        "param3": {"description": "Description of parameter 3",
 18                   "type": "type of param3",
 19                   "default": "default value if any"}
 20    },
 21    "selections": {
 22        "selection1": {"description": "Description of selection 1",
 23                       "type": "type of selection1"},
 24        "selection2": {"description": "Description of selection 2",
 25                       "type": "type of selection2"}
 26    },
 27    "example": "
 28    {
 29        \"type\": \"__SIMULATION_STEPS_TEMPLATE__\",
 30        \"parameters\": {
 31            \"intervalStep\": 100,
 32            \"param1\": value1,
 33            \"param2\": value2,
 34            \"selection1\": \"model1 type A\",
 35            \"selection2\": \"model2 type B\"
 36        }
 37    }
 38    "
 39    }
 40    """
 41
 42    availableParameters = {"intervalStep", "param1", "param2", "param3"}
 43    requiredParameters = {"intervalStep", "param1", "param2"}
 44    availableSelections = {"selection1", "selection2"}
 45    requiredSelections = {"selection1"}
 46
 47    def __init__(self, name, **params):
 48        super().__init__(_type=self.__class__.__name__,
 49                         _name=name,
 50                         availableParameters=self.availableParameters,
 51                         requiredParameters=self.requiredParameters,
 52                         availableSelections=self.availableSelections,
 53                         requiredSelections=self.requiredSelections,
 54                         **params)
 55
 56        ############################################################
 57        # Access and process parameters
 58        ############################################################
 59
 60        intervalStep = params["intervalStep"]
 61        param1 = params["param1"]
 62        param2 = params["param2"]
 63        param3 = params.get("param3", "default_value")
 64
 65        # Process selections
 66        selection1 = self.getSelection("selection1")
 67        selection2 = self.getSelection("selection2") if "selection2" in params else None
 68
 69        ############################################################
 70        # Set up the simulation step
 71        ############################################################
 72
 73        simulationStep = {
 74            name: {
 75                "type": ["SimulationStepType", "SimulationStepSubType"],
 76                "parameters": {
 77                    "intervalStep": intervalStep,
 78                    "param1": param1,
 79                    "param2": param2,
 80                    "param3": param3
 81                }
 82            }
 83        }
 84
 85        # If the simulation step requires additional data, add it here
 86        if selection1:
 87            simulationStep[name]["labels"] = ["id"]
 88            simulationStep[name]["data"] = [[id] for id in selection1]
 89
 90        # Set the group if needed (e.g., if the step applies to a specific selection)
 91        self.setGroup("selection1")
 92
 93        # Set the simulation step
 94        self.setSimulationStep(simulationStep)
 95
 96        ############################################################
 97        # Log simulation step setup
 98        ############################################################
 99
100        self.logger.info(f"Initialized {name} simulation step with interval {intervalStep}")
101
102    def _additional_processing(self, selection):
103        # Example method for additional processing if needed
104        pass