### Install GKPlugin Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKPlugin The install() method is responsible for performing any necessary setup or installation tasks when the GKPlugin is activated within Aimsun Next. This method is called automatically by the Aimsun Next environment. ```python def install(): """Installs the plugin and performs any necessary setup.""" pass ``` -------------------------------- ### Handle System Ready State Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKPlugin The systemReady() method is called once the Aimsun Next simulation environment is fully initialized and ready for operation. Plugins can use this method to perform final setup tasks that depend on the complete system state. ```python def systemReady(): """Called when the Aimsun Next system is ready.""" pass ``` -------------------------------- ### Get Conflict Extents for Second Entity Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKNodeConflict Gets the starting and ending distances of the conflict along the second entity. These are represented as float values. ```python start_dist = gk_node_conflict.getSecondEntityXIni() end_dist = gk_node_conflict.getSecondEntityXEnd() ``` -------------------------------- ### Initial State and Path Settings Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKExperiment Configure initial state trees and path settings. ```APIDOC ## Initial State and Path Settings ### Description Configure initial state trees and related path calculation settings. ### Methods - **setInitialSPTrees(_value_)** - **Parameters**: - **value** (int) - The value for initial shortest path trees. - **setSPTreeGenerationType(_value_)** - **Parameters**: - **value** (`ShortestPathTreeGeneration`) - The type of shortest path tree generation. ``` -------------------------------- ### Get Conflict Extents for First Entity Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKNodeConflict Gets the starting and ending distances of the conflict along the first entity. These are represented as float values. ```python start_dist = gk_node_conflict.getFirstEntityXIni() end_dist = gk_node_conflict.getFirstEntityXEnd() ``` -------------------------------- ### Get Permissive Period Start (Python) Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKControlPhase Retrieves the start time of the permissive period for the phase. This timing parameter is relevant for specific control modes. ```Python perm_start = control_phase.getPermissivePeriodFrom() ``` -------------------------------- ### DistributionExperimentParams Class Methods (Python) Source: https://docs.aimsun.com/next/26.0.0/scripting/PyDistributionPlugin/DistributionExperimentParams This snippet covers the initialization and key methods of the DistributionExperimentParams class. It includes the constructor (__init__), methods for managing preload experiments (getPreloadExperiment, setPreloadExperiment), retrieving the type name (_getTypeName), and validating parameters (_validParameters). ```Python class DistributionExperimentParams: def __init__(self): pass def getPreloadExperiment(self) -> int: pass def setPreloadExperiment(self, iExperiment: int): pass def _getTypeName(self) -> str: pass def _validParameters(self, iModel: GKModel) -> bool: pass ``` -------------------------------- ### Get Start Time from GKScheduleMasterControlJunctionItem (Python) Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKScheduleMasterControlJunctionItem Retrieves the start time in seconds for the schedule master control junction item. This method returns an integer representing the start time. ```Python start_seconds = item.getFrom() ``` -------------------------------- ### G2DDrawContext.__init__() Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGGui/G2DDrawContext Initializes the G2DDrawContext with a given context. ```APIDOC ## __init__(__context_) ### Description Initializes the G2DDrawContext with a given context. ### Method * `__init__` ### Parameters #### Path Parameters * **__context_** (`G2DDrawContext`) - Required - The drawing context for the 2D view. ### Request Example ```python # Assuming 'draw_context' is an instance of G2DDrawContext draw_context.__init__(some_context) ``` ### Response This method does not return a value. ``` -------------------------------- ### Get Phase Start Time (Python) Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKControlPhase Retrieves the start time of the control phase within its cycle. The time is a float value between 0 and the total cycle time. ```Python start_time = control_phase.getFrom() ``` -------------------------------- ### GViewWindow Initialization Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGGui/GViewWindow Initializes a GViewWindow instance. It requires a GGui object, a GKModel, a parent QWidget, and window flags. ```python def __init__(_agui_, _amodel_, _parent_, _wflags_): # Parameters: # agui – GGui # amodel – GKModel # parent – QWidget # wflags – Combination of WindowType ``` -------------------------------- ### PyANGKernel.GKControlJunction: Get Starts At Time Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKControlJunction Retrieves the specific time at which a phase is set to start. This applies to fixed-time control or scheduled operations. ```python start_time = junction.getStartsAt(phase_id) ``` -------------------------------- ### G2DDrawContext.__init__(_v_, _w_, _c_) Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGGui/G2DDrawContext Initializes the G2DDrawContext with a view, bounding box, and context. ```APIDOC ## __init__(_v_ , _w_ , _c_) ### Description Initializes the G2DDrawContext with a view, bounding box, and context. ### Method * `__init__` ### Parameters #### Path Parameters * **v** (`G2DView`) - Required - The 2D view. * **w** (`GKBBox`) - Required - The bounding box. * **c** (`GKContext`) - Required - The context. ### Request Example ```python # Assuming 'draw_context' is an instance of G2DDrawContext draw_context.__init__(view_instance, bbox_instance, context_instance) ``` ### Response This method does not return a value. ``` -------------------------------- ### PyANGKernel.GKControlJunction: Get Signals Start Duration Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKControlJunction Retrieves the duration for which signals start at the beginning of a phase. This is related to initial signal display. ```python start_duration = junction.getSignalsStartDuration(phase_id) ``` -------------------------------- ### Aimsun Next Scripting API - Initialization (__init__) Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKBiasedPositionGenerator Provides documentation for the various overloaded __init__ methods used for initializing objects in the Aimsun Next scripting API. These constructors allow for different combinations of parameters to define granularity, distance saturation, attraction factor, and optional boundary and seed values. ```APIDOC ## __init__() API Documentation ### Description Default constructor for factory use with set methods. ### Method __init__ ### Parameters This method has multiple overloads: **Overload 1:** * **granularity** (float) - Required * **distanceSaturation** (float) - Required * **attractionFactor** (float) - Required * **useBuildingInterior** (bool) - Optional (defaults to false) * **seed** (int) - Optional (defaults to 42UL) **Overload 2:** * **boundary** (GKPolygon) - Required * **granularity** (float) - Required * **distanceSaturation** (float) - Required * **attractionFactor** (float) - Required * **useBuildingInterior** (bool) - Optional (defaults to false) * **seed** (int) - Optional (defaults to 42UL) **Overload 3:** * **boundary** (GKPolygonWithHoles) - Required * **granularity** (float) - Required * **distanceSaturation** (float) - Required * **attractionFactor** (float) - Required * **useBuildingInterior** (bool) - Optional (defaults to false) * **seed** (int) - Optional (defaults to 42UL) **Overload 4:** * **attractiveSegments** (list of GKSegment) - Required * **granularity** (float) - Required * **distanceSaturation** (float) - Required * **attractionFactor** (float) - Required * **useBuildingInterior** (bool) - Optional (defaults to false) * **seed** (int) - Optional (defaults to 42UL) **Overload 5:** * **boundary** (GKPolygon) - Required * **attractiveSegments** (list of GKSegment) - Required * **granularity** (float) - Required * **distanceSaturation** (float) - Required * **attractionFactor** (float) - Required * **useBuildingInterior** (bool) - Optional (defaults to false) * **seed** (int) - Optional (defaults to 42UL) **Overload 6:** * **boundary** (GKPolygonWithHoles) - Required * **attractiveSegments** (list of GKSegment) - Required * **granularity** (float) - Required * **distanceSaturation** (float) - Required * **attractionFactor** (float) - Required * **useBuildingInterior** (bool) - Optional (defaults to false) * **seed** (int) - Optional (defaults to 42UL) ### Request Example ```python # Example for Overload 1 obj = __init__(granularity=0.5, distanceSaturation=10.0, attractionFactor=0.8) # Example for Overload 2 polygon = GKPolygon() obj = __init__(boundary=polygon, granularity=0.5, distanceSaturation=10.0, attractionFactor=0.8) ``` ### Response This method is a constructor and does not return a value in the traditional sense; it initializes an object. ``` -------------------------------- ### Get Schedule Start Time Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKPublicLineTimeTableSchedule Returns the time at which this schedule becomes valid and active. This is the starting point from which the simulator will apply this schedule's configuration. ```Python def getTime(): """getTime() Return type: `QTime` Returns the time starting from which this schedule is valid. """ pass ``` -------------------------------- ### Instant Emission (Model to GUI) Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKSystem Converts instant pollutant emission from model units (e.g., g/s) to GUI units (e.g., g/s). ```APIDOC ## instantEmissionModelToGui ### Description Converts instant pollutant emission from model units (e.g., g/s) to GUI units (e.g., g/s). ### Method N/A (This appears to be a function call within a scripting environment, not a traditional HTTP API endpoint.) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```python # Assuming 'units' is a UnitSystem object and 'e' is the emission value emission_g_per_s = instantEmissionModelToGui(units, e) ``` ### Response #### Success Response (200) - **float**: The converted instant pollutant emission in GUI units. #### Response Example ```json { "emission_g_per_s": 0.1 } ``` ``` -------------------------------- ### Object Initialization and Management Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKCatalog Methods for initializing the simulation model and managing objects within the catalog. ```APIDOC ## `__init__()` ### Description Initializes the object. ### Method `__init__` ### Endpoint N/A (Constructor) ### Parameters None ### Request Example ```python # Example usage: # model = AimsunObject() ``` ### Response None ``` ```APIDOC ## `add(_obj_)` ### Description Adds a given object to the model catalog. ### Method `add` ### Endpoint N/A ### Parameters - **obj** (`GKObject`) - The object to add to the catalog. ### Request Example ```python # Assuming 'my_object' is a GKObject instance # catalog.add(my_object) ``` ### Response None ``` ```APIDOC ## `remove(_obj_)` ### Description Removes an object from the model catalog. ### Method `remove` ### Endpoint N/A ### Parameters - **obj** (`GKObject`) - The object to remove from the catalog. ### Request Example ```python # Assuming 'my_object' is a GKObject instance # catalog.remove(my_object) ``` ### Response None ``` ```APIDOC ## `size()` ### Description Returns the total number of objects in the model catalog. ### Method `size` ### Endpoint N/A ### Parameters None ### Request Example ```python # num_objects = catalog.size() ``` ### Response - **Return Value** (int) - The number of objects in the catalog. ``` ```APIDOC ## `setModel(_model_)` ### Description Sets the model for the current catalog. ### Method `setModel` ### Endpoint N/A ### Parameters - **model** (`GKModel`) - The model to set. ### Request Example ```python # Assuming 'my_model' is a GKModel instance # catalog.setModel(my_model) ``` ### Response None ``` ```APIDOC ## `isTemporary()` ### Description Checks if the object is temporary. ### Method `isTemporary` ### Endpoint N/A ### Parameters None ### Request Example ```python # is_temp = my_object.isTemporary() ``` ### Response - **Return Value** (bool) - True if the object is temporary, False otherwise. ``` -------------------------------- ### Get Active View Setup Usage in GKPrintLayoutItemMap2D Source: https://docs.aimsun.com/next/26.0.0/scripting/PyPrintLayout/GKPrintLayoutItemMap2D Checks if the active view setup is being used for the 2D map view. Returns a boolean value. ```python uses_active_setup = layout_item_map2d.getUseActiveViewSetup() ``` -------------------------------- ### Example: Getting Parent Section (Python) Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKSectionObject Illustrates how to retrieve the parent GKSection object to which a GKSectionObject belongs. ```python # Assuming 'my_object' is an instance of GKSectionObject parent_section = my_object.getSection() if parent_section: print(f"Object belongs to section: {parent_section.getName()}") # Assuming GKSection has a getName() method ``` -------------------------------- ### GKExperiment - Initialization and Utility Methods Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKExperiment This section covers initialization and other utility methods within the GKExperiment class. ```APIDOC ## GKExperiment Initialization and Utility Methods ### Description Provides methods for initializing simulation components and performing utility operations within the experiment. ### Methods A mix of initialization and operational methods. ### Endpoints N/A (These are method calls within a script context, not REST endpoints) ### Parameters N/A ### Request Example ```python # Example of calling an initialization method GKExperiment.initialSPTrees() print("Initial SP trees computed.") # Example of calling a utility method if GKExperiment.isMicro(): print("Micro-simulation is enabled.") ``` ### Response #### Success Response - **Return Value** (type) - Description of the returned value (e.g., bool, void, status indicator). #### Response Example ```json { "status": "completed" } ``` **Specific Methods:** - `GKExperiment.initialSPTrees()` - `GKExperiment.intervalsRC()` - `GKExperiment.isCustomModel()` - `GKExperiment.isMacro()` - `GKExperiment.isMeso()` - `GKExperiment.isMicro()` - `GKExperiment.isPolicyActive()` - `GKExperiment.maxAssignmentResultsPaths()` - `GKExperiment.maxODRoutesPaths()` - `GKExperiment.relativeGapMatrix()` ``` -------------------------------- ### Get Start Time for GKScheduleMasterControlMeteringItem Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKScheduleMasterControlMeteringItem Retrieves the start time (in seconds) for the GKScheduleMasterControlMeteringItem. This method is essential for defining the temporal scope of control metering items in Aimsun Next simulations. ```python getFrom() ``` -------------------------------- ### Instant Emission (GUI to Model) Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKSystem Converts instant pollutant emission from GUI units (e.g., g/s) to model units (e.g., g/s). ```APIDOC ## instantEmissionGuiToModel ### Description Converts instant pollutant emission from GUI units (e.g., g/s) to model units (e.g., g/s). ### Method N/A (This appears to be a function call within a scripting environment, not a traditional HTTP API endpoint.) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```python # Assuming 'units' is a UnitSystem object and 'e' is the emission value emission_g_per_s = instantEmissionGuiToModel(units, e) ``` ### Response #### Success Response (200) - **float**: The converted instant pollutant emission in model units. #### Response Example ```json { "emission_g_per_s": 0.1 } ``` ``` -------------------------------- ### Python: Get Start Time of ScheduleDemandItem Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKScheduleDemandItem Retrieves the start time of the schedule demand item in seconds, relative to the beginning of the first day of the initial demand (00:00:00). ```python start_time = item.getFrom() ``` -------------------------------- ### MacroPTZonePlan Class Methods Source: https://docs.aimsun.com/next/26.0.0/scripting/PyMacroPTPlugin/MacroPTZonePlan This section details the methods available for the MacroPTZonePlan class, including its initialization and a method to retrieve associated MacroPTZone objects. ```APIDOC ## MacroPTZonePlan Class ### Description Represents a plan for a public transport zone within Aimsun Next scripting. ### Methods #### `__init__()` ##### Description Constructor for the `MacroPTZonePlan` class. ##### Method __init__ ##### Endpoint N/A (Class Constructor) #### `asMacroZones()` ##### Description Retrieves a list of `MacroPTZone` objects associated with this plan. ##### Method asMacroZones ##### Endpoint N/A (Method of MacroPTZonePlan instance) ##### Parameters None ##### Response ###### Success Response (200) - **return_value** (list of MacroPTZone) - A list containing `MacroPTZone` objects. ###### Response Example ```json { "return_value": [ { "type": "MacroPTZone", "id": 1, "name": "Zone 1" }, { "type": "MacroPTZone", "id": 2, "name": "Zone 2" } ] } ``` ``` -------------------------------- ### Get Phase Begin Coordinate (Python) Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKControlPhase Retrieves the starting coordinate information for the control phase. This is represented by a GKControlPhaseBeginCoord object. ```Python begin_coord = control_phase.getBeginCoord() ``` -------------------------------- ### ForestCalculator.init() Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/ForestCalculator Describes the abstract `init` virtual method for initializing the calculator. ```APIDOC ## Method: ForestCalculator.init ### Description Abstract method to initialize the ForestCalculator. Must be implemented by subclasses. ``` -------------------------------- ### GET isValid Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKTrafficDemand Returns true if the demand is valid: - No holes between demand items. - All the vehicles demands start and end at the same time. - There is no overlap between items. ```APIDOC ## GET isValid ### Description Returns true if the demand is valid. Reports errors in the Log window if reportErrors is true. ### Method GET ### Endpoint /GKTrafficDemand/isValid ### Parameters #### Path Parameters - **reportErrors** (bool) - Optional - If true, the error will be shown in the Log window. Default is true. - **checkHoles** (bool) - Optional - Checks for holes in the demand. Default is true. ### Request Example N/A ### Response #### Success Response (200) - **bool** - True if valid, false otherwise. #### Response Example true ``` -------------------------------- ### PyANGKernel.GKSimulationArea Class Methods Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKSimulationArea This section outlines the various methods available for interacting with the GKSimulationArea class, including initialization, section management, gate calculations, and object classification. ```APIDOC ## PyANGKernel.GKSimulationArea ### Description Represents a simulation area within Aimsun Next, providing methods to manage and query sections, gates, and objects within that area. ### Methods * `__init__()`: Initializes a new GKSimulationArea object. * `addManualSection(section)`: Adds a manual section to the simulation area. * `calculateGates()`: Calculates gate information for the simulation area. * `classifyObjectsByManualSections()`: Classifies objects based on manual sections. * `classifyObjectsByPolygon(polygon)`: Classifies objects within a given polygon. * `clearGatesInfo()`: Clears all gate information from the simulation area. * `containsManualSection(section)`: Checks if a manual section is present in the simulation area. * `containsObject(obj)`: Checks if a given object is within the simulation area. * `count()`: Returns the number of elements in the simulation area. * `getEntranceGates()`: Retrieves all entrance gates associated with the simulation area. * `getExitGates()`: Retrieves all exit gates associated with the simulation area. * `getInsideCentroidsEntranceGates()`: Gets entrance gates based on inside centroids. * `getInsideCentroidsExitGates()`: Gets exit gates based on inside centroids. * `getManualSections()`: Retrieves all manual sections within the simulation area. * `getNbAllNodes()`: Gets the total number of nodes in the simulation area. * `getNbNodes()`: Gets the number of nodes within the simulation area. * `getNbSections()`: Gets the number of sections in the simulation area. * `getSectionsAndTurns()`: Retrieves sections and turns associated with the simulation area. * `removeManualSection(section)`: Removes a manual section from the simulation area. * `setManualSections(sections)`: Sets the manual sections for the simulation area. * `useManualSections(use)`: Enables or disables the use of manual sections. * `usingManualSections()`: Checks if manual sections are currently in use. ``` -------------------------------- ### PyANGKernel.NSPForest Class Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/NSPForest This class provides all the assignment paths and information about the paths within the Aimsun Next simulation. ```APIDOC ## PyANGKernel.NSPForest ### Description This class provides all the assignment paths and information about the paths. ### Methods - `__init__(_model_, _t_) - Parameters: - **model** (`GKModel`) - The simulation model. - **t** (`ForestType`) - The type of the forest. - Description: Constructor for the NSPForest class. - `allIntervalForSameDay()` - Return type: `bool` - Description: Returns true if the intervals are for the same day. - `getNumberIntervalStats()` - Return type: `int` - Description: Gets the number of intervals used for path statistics. - `getNumberIterations()` - Return type: `int` - Description: Gets the number of iterations for the simulation. - `getNumberPahtsAlternatives(_vehType_) - Parameters: - **vehType** (int) - The vehicle type. - Return type: `int` - Description: Gets the number of alternative paths for a given vehicle type. - `getRouteChoiceCycle()` - Return type: `float` - Description: Gets the route choice cycle duration. - `getWarmUpPeriod()` - Return type: `float` - Description: Gets the total warm-up period of the simulation. - `getWarmupIntervals()` - Return type: `int` - Description: Gets the number of warm-up intervals. - `setNumberIterations(_value_) - Parameters: - **value** (int) - The number of iterations to set. - Description: Sets the number of iterations for the simulation. - `setNumberPathsAlternatives(_vehType_, _value_) - Parameters: - **vehType** (int) - The vehicle type. If -1, sets for all vehicle types. - **value** (int) - The number of alternative paths to set. - Description: Sets the number of alternative paths. If vehType is -1, sets the value for all vehicle types in this forest. - `setRouteChoiceCycle(_value_) - Parameters: - **value** (float) - The route choice cycle duration to set. - Description: Sets the route choice cycle duration. - `setUsageAnalysis(_value_) - Parameters: - **value** (bool) - Whether to use this for analysis. - Description: Sets whether the usage of this apa (alternative path assignment) is to be used for analysis. - `setWarmUpPeriod(_value_) - Parameters: - **value** (float) - The warm-up period to set. - Description: Sets the total warm-up period. - `setWarmupIntervals(_n_) - Parameters: - **n** (int) - The number of warm-up intervals to set. - Description: Sets the number of warm-up intervals. ``` -------------------------------- ### Python: Get Waiting Time Skim Source: https://docs.aimsun.com/next/26.0.0/scripting/PyLandUsePlugin/GKLandUseSkimMatricesUtil Retrieves the waiting time skim matrix. This represents the time spent waiting, for example, for public transport. ```python from PySide6.Aim6.Core import GKODMatrix, GKLandUseSkimMatricesUtil waiting_time = GKLandUseSkimMatricesUtil.waitingTimeSkim() if waiting_time: print("Waiting time skim retrieved.") ``` -------------------------------- ### GKGenerationAttractionScenario Initialization and Basic Methods Source: https://docs.aimsun.com/next/26.0.0/scripting/PyLandUsePlugin/GKGenerationAttractionScenario This section covers the initialization of the GKGenerationAttractionScenario object and fundamental methods for managing modes and purposes. ```APIDOC ## GKGenerationAttractionScenario - Initialization and Management ### Description Provides methods for initializing a GKGenerationAttractionScenario object and managing its modes and purposes. ### Methods - `__init__()`: Initializes a new instance of GKGenerationAttractionScenario. - `addMode(mode)`: Adds a mode to the scenario. - `addPurpose(purpose)`: Adds a purpose to the scenario. - `removeMode(mode)`: Removes a mode from the scenario. - `removePurpose(purpose)`: Removes a purpose from the scenario. - `getModes()`: Retrieves the list of currently added modes. - `getPurposes()`: Retrieves the list of currently added purposes. ### Parameters * `mode` (string): The mode to add or remove. * `purpose` (string): The purpose to add or remove. ### Request Example (Conceptual) ```json { "action": "addMode", "parameters": { "mode": "Car" } } ``` ### Response Example (Conceptual) ```json { "status": "success", "result": "Mode 'Car' added successfully." } ``` ``` -------------------------------- ### Get GKViewModeStyleRange Values and Properties Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKViewModeStyleRange Provides methods to retrieve various properties of the GKViewModeStyleRange object. This includes getting the starting and ending values of the range, the current style value, pen size, and maximum pen size. ```python starting_value = gk_view_mode_style_range.getStartingValue() ending_value = gk_view_mode_style_range.getEndingValue() current_value = gk_view_mode_style_range.getValue() pen_size = gk_view_mode_style_range.getPenSize() max_pen_size = gk_view_mode_style_range.getMaxPenSize() ``` -------------------------------- ### Get GKSimEntity X Ini in Python Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKSimEntity Retrieves the starting X-coordinate of the simulation entity. Returns a float value. ```python def getXIni(): # Returns the starting X-coordinate as a float return 0.0 ``` -------------------------------- ### GKNetworkAttributesOverrideNewCmd.__init__() Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKNetworkAttributesOverrideNewCmd Initializes a new, empty simulation settings object. ```APIDOC ## GKNetworkAttributesOverrideNewCmd.__init__() ### Description Initializes a new, empty, simulation settings object. ### Method `__init__` ### Endpoint N/A (Class constructor) ### Parameters None ### Request Example ```json { "example": "No request body needed for constructor" } ``` ### Response #### Success Response (N/A) This is a constructor, it does not return a value in the traditional sense. It creates an instance of the object. #### Response Example ```json { "example": "No response body, object is instantiated" } ``` ``` -------------------------------- ### PyANGKernel.GKPTZone Class Documentation Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKPTZone Documentation for the GKPTZone class and its associated methods. ```APIDOC ## PyANGKernel.GKPTZone Class ### Description Represents a zone in the Aimsun Next simulation, typically used for grouping or managing bus stops. ### Methods #### `__init__()` * **Description**: Initializes a new GKPTZone object. * **Method**: N/A (Constructor) * **Endpoint**: N/A #### `addStop(_iStop_)` * **Description**: Adds a bus stop to the GKPTZone. * **Method**: N/A * **Endpoint**: N/A * **Parameters**: * **iStop** (`GKBusStop`) - Required - The bus stop to add. #### `convexHull()` * **Description**: Computes the convex hull of the zone based on its stops. * **Method**: N/A * **Endpoint**: N/A * **Returns**: * `GKPoints` - The points defining the convex hull. #### `removeStop(_iStop_)` * **Description**: Removes a bus stop from the GKPTZone. * **Method**: N/A * **Endpoint**: N/A * **Parameters**: * **iStop** (`GKBusStop`) - Required - The bus stop to remove. #### `setStops(_iStops_)` * **Description**: Sets the list of bus stops for the GKPTZone. * **Method**: N/A * **Endpoint**: N/A * **Parameters**: * **iStops** (list of `GKBusStop` or `QSetGKBusStop`) - Required - The list or set of bus stops to assign. #### `stops()` * **Description**: Retrieves the list of bus stops currently associated with the GKPTZone. * **Method**: N/A * **Endpoint**: N/A * **Returns**: * `.QSetGKBusStop` - A set containing the bus stops in the zone. ``` -------------------------------- ### Get All Stop Lines Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKTurning Retrieves a list of all stop lines associated with the turn. The distance of each stop line is given relative to the start of the turn in meters. ```python stop_lines = turn.getStopLines() ``` -------------------------------- ### Get Time Series From Time (Python) Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKTSDescription Retrieves the start time ('from' time) of a time series description. This function does not require any parameters and returns a QDateTime object. ```python def getFromTime() # Returns QDateTime ``` -------------------------------- ### Instant Battery Consumption (Model to GUI) Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKSystem Converts instant battery consumption from model units (e.g., ml/s) to GUI units (e.g., Wh/s). ```APIDOC ## instantBatteryConsumptionModelToGui ### Description Converts instant battery consumption from model units (e.g., ml/s) to GUI units (e.g., Wh/s). ### Method N/A (This appears to be a function call within a scripting environment, not a traditional HTTP API endpoint.) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```python # Assuming 'units' is a UnitSystem object and 'fc' is the consumption value consumption_wh_per_s = instantBatteryConsumptionModelToGui(units, fc) ``` ### Response #### Success Response (200) - **float**: The converted instant battery consumption in GUI units. #### Response Example ```json { "consumption_wh_per_s": 15.2 } ``` ``` -------------------------------- ### GKGenerationAttractionScenario Initialization Source: https://docs.aimsun.com/next/26.0.0/scripting/PyLandUsePlugin/GKGenerationAttractionScenario Initializes a new instance of the GKGenerationAttractionScenario class. ```APIDOC ## GKGenerationAttractionScenario `__init__()` ### Description Initializes a new instance of the GKGenerationAttractionScenario class. ### Method `__init__` ### Endpoint N/A (Constructor) ### Parameters None ### Request Example ```python scenario = GKGenerationAttractionScenario() ``` ### Response #### Success Response (N/A) Returns a new `GKGenerationAttractionScenario` object. #### Response Example N/A ``` -------------------------------- ### Get Section Object Position in Lanes (Python) Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKSectionObject Returns the distance of the section object's initial point along the lanes' line, relative to the lanes' start. ```python section_object.getPositionInLanes() ``` -------------------------------- ### GKSPManager - Initialization Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKSPManager Initializes the GKSPManager. ```APIDOC ## __init__ __init__() ### Description Initializes the GKSPManager. ### Method __init__ ### Endpoint N/A (Constructor) ### Parameters None ### Request Example None ### Response None ``` -------------------------------- ### Get Control Plan for Time Range Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKMasterControlPlan Retrieves the control plan for a given time range. Requires start and end times as integers and returns a GKControlPlan object. ```python def getPlanForTime(_fromTime_ , _toTime_): """ Get the control information based in the from and to times Parameters: fromTime – int toTime – int Return type: GKControlPlan """ pass ``` -------------------------------- ### Get Permissive Period End (Python) Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKControlPhase Retrieves the end time of the permissive period for the phase. This timing parameter complements the start time for defining the permissive interval. ```Python perm_end = control_phase.getPermissivePeriodTo() ``` -------------------------------- ### Visibility and Warning Settings Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKTurning Methods to set visibility distances and warning indicators. ```APIDOC ## setVisibilityDistance /aValue/ ### Description Sets the visibility distance. ### Method (Not specified, likely a Python method call) ### Endpoint (Not applicable, this is a method within a class) ### Parameters #### Path Parameters (None) #### Query Parameters (None) #### Request Body (None) ### Request Example ```python GKTurning.setVisibilityDistance(aValue) ``` ### Response #### Success Response (200) (No specific return type mentioned, implies void or internal state change) #### Response Example (None) ``` ```APIDOC ## setVisibilityDistanceMainStream /aValue/ ### Description Sets the visibility distance for the main stream. ### Method (Not specified, likely a Python method call) ### Endpoint (Not applicable, this is a method within a class) ### Parameters #### Path Parameters (None) #### Query Parameters (None) #### Request Body (None) ### Request Example ```python GKTurning.setVisibilityDistanceMainStream(aValue) ``` ### Response #### Success Response (200) (No specific return type mentioned, implies void or internal state change) #### Response Example (None) ``` ```APIDOC ## setVisibilityDistanceMainStreamMeso /aValue/ ### Description Sets the visibility distance for the main stream in meso mode. ### Method (Not specified, likely a Python method call) ### Endpoint (Not applicable, this is a method within a class) ### Parameters #### Path Parameters (None) #### Query Parameters (None) #### Request Body (None) ### Request Example ```python GKTurning.setVisibilityDistanceMainStreamMeso(aValue) ``` ### Response #### Success Response (200) (No specific return type mentioned, implies void or internal state change) #### Response Example (None) ``` ```APIDOC ## setWaitingTimeBeforeLosingTurn /aValue/ ### Description Sets the waiting time before losing turn. ### Method (Not specified, likely a Python method call) ### Endpoint (Not applicable, this is a method within a class) ### Parameters #### Path Parameters (None) #### Query Parameters (None) #### Request Body (None) ### Request Example ```python GKTurning.setWaitingTimeBeforeLosingTurn(aValue) ``` ### Response #### Success Response (200) (No specific return type mentioned, implies void or internal state change) #### Response Example (None) ``` ```APIDOC ## setWarningIndicator /givewayIndicator/ ### Description Sets the warning indicator. ### Method (Not specified, likely a Python method call) ### Endpoint (Not applicable, this is a method within a class) ### Parameters #### Path Parameters (None) #### Query Parameters (None) #### Request Body (None) ### Request Example ```python GKTurning.setWarningIndicator(givewayIndicator) ``` ### Response #### Success Response (200) (No specific return type mentioned, implies void or internal state change) #### Response Example (None) ``` -------------------------------- ### Experiment and Task Creation Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKSystem APIs for creating new experiments and tasks within the Aimsun Next simulation environment. ```APIDOC ## Experiment and Task Creation ### `createExperiment(_scenario_ , _engineId_ , _mode_)` Creates a new experiment based on a given scenario, engine ID, and mode. * **Parameters**: * `scenario` (`GKScenario`) - The scenario for the experiment. * `engineId` (int) - The ID of the simulation engine. * `mode` (int) - The simulation mode. * **Return type**: `GKGenericExperiment` ### `createInternalTask(_model_[, _uid= ``` -------------------------------- ### Get Meso Safety Margin Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKTurning Retrieves the initial safety margin for Meso simulation. This defines the safety distance required at the start of a turn in a meso-simulation context. ```python turn.getInitialSafetyMarginMeso() ``` -------------------------------- ### Initialization and Queue Management Source: https://docs.aimsun.com/next/26.0.0/scripting/PyFourStepsPlugin/NodeCompute Methods for initializing objects, adding them to queues, and checking their queue status. ```APIDOC ## Initialization and Queue Management ### Description Provides methods for object initialization, queue management, and status checks related to processing queues. ### Methods - `__init__()`: Constructor for the object. - `addToQueue()`: Adds the object to the processing queue. - `removeFromQueue()`: Removes the object from the processing queue. - `isOnQueue()`: Checks if the object is currently in the queue. - `areOriginsOnQueue()`: Checks if the origins of the object are on the queue. ### Parameters No general parameters for these methods. Specific parameters are detailed for individual methods where applicable. ``` -------------------------------- ### Get Lane Sub-Area Geometry Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKSection Retrieves a polygon representing a sub-area within a specific lane of a section. The sub-area is defined by start and end points along the lane's length. ```Python def getSubAreaForLane(_lanePos_, _fromInLane_, _toInLane_): # ... function implementation ... ``` -------------------------------- ### Static Functions Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKSystem Provides access to static utility functions for system management and initialization checks. ```APIDOC ## Static functions ### `deleteSystem()` Deletes the current Aimsun Next system. ### `exit()` Exits the Aimsun Next application. ### `getSystem()` Retrieves the current Aimsun Next system object. ### `isInitialized()` Checks if the Aimsun Next system has been initialized. ``` -------------------------------- ### Get PT Entrance Gates (Python) Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKTraversal Returns a map of sections that are the first section in Transit routes starting inside the subnetwork. Keys are section IDs and values are GKSection objects. ```Python getPTEntranceGates() ``` -------------------------------- ### Instant Battery Consumption (GUI to Model) Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKSystem Converts instant battery consumption from GUI units (e.g., Wh/s) to model units (e.g., ml/s). ```APIDOC ## instantBatteryConsumptionGuiToModel ### Description Converts instant battery consumption from GUI units (e.g., Wh/s) to model units (e.g., ml/s). ### Method N/A (This appears to be a function call within a scripting environment, not a traditional HTTP API endpoint.) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```python # Assuming 'units' is a UnitSystem object and 'c' is the consumption value consumption_ml_per_s = instantBatteryConsumptionGuiToModel(units, c) ``` ### Response #### Success Response (200) - **float**: The converted instant battery consumption in model units. #### Response Example ```json { "consumption_ml_per_s": 0.5 } ``` ``` -------------------------------- ### Get First Point Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKPoints Retrieves the first GKPoint of the polyline. This method provides direct access to the starting point of the GKPoints object. ```python constFirst() ``` -------------------------------- ### PyANGKernel.GKViewModeNewCmd Class Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKViewModeNewCmd Documentation for the GKViewModeNewCmd class, including its constructor. ```APIDOC ## PyANGKernel.GKViewModeNewCmd ### Description Creates a new view mode. ### Methods #### def `__init__()` Constructor for the GKViewModeNewCmd class. ### Request Example ```json { "example": "Not applicable for constructor" } ``` ### Response Example ```json { "example": "Not applicable for constructor" } ``` -------------------------------- ### Get Start Trigger for a Specific Time in Python Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKSimulationEvent Returns the activation trigger for a specified time within a simulation event. If no trigger is configured for that time, it returns nullptr. Requires a QTime object. ```python getStartTrigger(_time_) ``` -------------------------------- ### Get Origin Lane Range for Turn Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKTurning Retrieves the leftmost (originFromLane) and rightmost (originToLane) lane numbers used by this turn within its origin section. Lane numbering starts from 0. ```python origin_from_lane = turn.getOriginFromLane() origin_to_lane = turn.getOriginToLane() ``` -------------------------------- ### Aimsun Next: Initialize GKExperimentStoppingCriteria Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKExperimentStoppingCriteria Initializes a new instance of the GKExperimentStoppingCriteria class. This method serves as the constructor for creating experiment stopping criteria objects. ```python gk_stopping_criteria = PyANGKernel.GKExperimentStoppingCriteria() ``` -------------------------------- ### Attractiveness and Capacity Settings Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKTurning Methods to control how capacity is used as attractiveness. ```APIDOC ## setUseCapacityAsAttractiveness /value/ ### Description If true (the default) the capacity is used as attractiveness. Otherwise, uses the attractiveness defined by the user. ### Method (Not specified, likely a Python method call) ### Endpoint (Not applicable, this is a method within a class) ### Parameters #### Path Parameters (None) #### Query Parameters (None) #### Request Body (None) ### Request Example ```python GKTurning.setUseCapacityAsAttractiveness(value) ``` ### Response #### Success Response (200) (No specific return type mentioned, implies void or internal state change) #### Response Example (None) ``` ```APIDOC ## useCapacityAsAttractiveness () ### Description Returns true if capacity is used as attractiveness (default behavior). Otherwise, returns false, indicating user-defined attractiveness is used. ### Method (Not specified, likely a Python method call) ### Endpoint (Not applicable, this is a method within a class) ### Parameters #### Path Parameters (None) #### Query Parameters (None) #### Request Body (None) ### Request Example ```python GKTurning.useCapacityAsAttractiveness() ``` ### Response #### Success Response (200) - **return_value** (bool) - True if capacity is used as attractiveness, False otherwise. #### Response Example ```json { "return_value": true } ``` ``` -------------------------------- ### Get Simulation Time from GKFunctionCostContext Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKFunctionCostContext Returns the absolute simulation time in seconds. For dynamic experiments, this represents the time elapsed since the simulation started. ```python sim_time = context.getTime() ``` -------------------------------- ### Get Rotated Section Sub-Area Geometry at Entrance Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKSection Retrieves a polygon within a section that is parallel to the entrance line angle. The polygon is defined by start and end points along the section length and specific lanes. ```Python def getSubAreaRotatedAtEntrance(_from_, _to_, _fromLane_, _toLane_): # ... function implementation ... ``` -------------------------------- ### Method: __init__ Source: https://docs.aimsun.com/next/26.0.0/scripting/PyMacroPTPlugin/MacroPTExperimentParams Initializes a new instance of the MacroPTExperimentParams class. ```APIDOC ## Method: __init__ ### Description Initializes a new instance of the `MacroPTExperimentParams` class. ### Method `__init__()` ### Endpoint N/A (Constructor) ``` -------------------------------- ### Get Initial Offset of Side Lane Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKSectionLane The getInitialOffset() method returns the initial offset for side lanes. For main lanes, it returns 0.0. This value represents the lane's start position relative to the section. ```python from PySide6.aimsun import GKSectionLane section_lane = GKSectionLane() initial_offset = section_lane.getInitialOffset() print(f"Initial offset: {initial_offset}") ``` -------------------------------- ### Instant Fuel Consumption (Model to GUI) Source: https://docs.aimsun.com/next/26.0.0/scripting/PyANGKernel/GKSystem Converts instant fuel consumption from model units (e.g., ml/s) to GUI units (e.g., ml/s or fl oz/s). ```APIDOC ## instantFuelConsumptionModelToGui ### Description Converts instant fuel consumption from model units (e.g., ml/s) to GUI units (e.g., ml/s or fl oz/s) depending of the units. ### Method N/A (This appears to be a function call within a scripting environment, not a traditional HTTP API endpoint.) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```python # Assuming 'units' is a UnitSystem object and 'fc' is the consumption value consumption_gui_units = instantFuelConsumptionModelToGui(units, fc) ``` ### Response #### Success Response (200) - **float**: The converted instant fuel consumption in GUI units. #### Response Example ```json { "consumption_gui_units": 2.5 } ``` ```