def page(self):
        pb = _m.ToolPageBuilder(self,
                                title="Multi-Class Road Assignment",
                                description="Cannot be called from Modeller.",
                                runnable=False,
                                branding_text="XTMF")

        return pb.render()
Exemple #2
0
    def page(self):
        pb = _m.ToolPageBuilder(self,
                                title="Return Boardings",
                                description="Cannot be called from Modeller.",
                                runnable=False,
                                branding_text="XTMF")

        return pb.render()
Exemple #3
0
    def page(self):
        pb = _m.ToolPageBuilder(self,
                                title="Export Network Batch File",
                                description="Cannot be called from Modeller.",
                                runnable=False,
                                branding_text="XTMF")

        return pb.render()
Exemple #4
0
    def page(self):

        pb = _m.ToolPageBuilder(self,
                                title="Import from Database (XTMF Internal)",
                                description="Cannot be called from Modeller.",
                                runnable=False,
                                branding_text="XTMF")

        return pb.render()
Exemple #5
0
 def page(self):
     pb = _m.ToolPageBuilder(self, runnable=False, title="Geometry",
                             description="Collection of private tools for performing geometric \
                                     operations from shapefiles.",
                             branding_text="- TMG Toolbox 2")
     
     pb.add_text_element("To import, call inro.modeller.Modeller().module('%s')" %str(self))
     
     return pb.render()
    def page(self):
        pb = _modeller.ToolPageBuilder(self, title="BKRCast Network Interface",
                     description="Export all extra attributes from current scenario",
                     branding_text="Modeling and Analysis Group -- City of Bellevue Transportation")
        pb.add_select_file("outputFolder", "directory", "", self.default_path, title = "Select the directory for output files")

        if self.tool_run_message != "":
            pb.tool_run_status(self.tool_run_msg_status)

        return pb.render()
Exemple #7
0
    def page(self):
        pb = _m.ToolPageBuilder(
            self,
            title="Extract Travel Time Matrices",
            description=
            "Extracts average in-vehicle, walking, waiting, and boarding time\
                     matrices from a strategy-based assignment.",
            branding_text="- TMG Toolbox")

        if self.tool_run_msg != "":  # to display messages in the page
            pb.tool_run_status(self.tool_run_msg_status)

        pb.add_select_scenario(tool_attribute_name='scenario',
                               title='Scenario:',
                               allow_none=False)

        pb.add_select_mode(tool_attribute_name='modes',
                           filter=['TRANSIT', 'AUX_TRANSIT'],
                           allow_none=False,
                           title='Modes:',
                           note='Select modes used in the assignment.')

        pb.add_select_matrix(
            tool_attribute_name='ivttMatrix',
            title='IVTT Matrix:',
            filter=['FULL'],
            note=
            "If no matrix is selected, an available matrix will be created.",
            allow_none=True)

        pb.add_select_matrix(
            tool_attribute_name='walkMatrix',
            title='Walk Matrix:',
            filter=['FULL'],
            note=
            "If no matrix is selected, an available matrix will be created.",
            allow_none=True)

        pb.add_select_matrix(
            tool_attribute_name='waitMatrix',
            title='Wait Matrix:',
            filter=['FULL'],
            note=
            "If no matrix is selected, an available matrix will be created.",
            allow_none=True)

        pb.add_select_matrix(
            tool_attribute_name='boardingMatrix',
            title='Boarding Matrix:',
            filter=['FULL'],
            note=
            "If no matrix is selected, an available matrix will be created.",
            allow_none=True)

        return pb.render()
Exemple #8
0
    def page(self):
        pb = _modeller.ToolPageBuilder(self, title="BKRCast Network Interface",
                     description="Path based Assignment on Multiple Scenarios",
                     branding_text="Modeling and Analysis Group -- City of Bellevue Transportation")
        pb.add_select_scenario("scenarios_list", title = "Select scenarios")
        pb.add_path_based_traffic_assignment_spec("path_specs_box", title = "Select specs")

        if self.tool_run_message != "":
            pb.tool_run_status(self.tool_run_msg_status)

        return pb.render()
Exemple #9
0
    def page(self):
        pb = _m.ToolPageBuilder(self,
                                runnable=False,
                                title="Spatial Index",
                                description="For internal use only.",
                                branding_text="- TMG Toolbox")

        pb.add_text_element(
            "To import, call inro.modeller.Modeller().module('%s')" %
            str(self))

        return pb.render()
Exemple #10
0
    def page(self):
        pb = _m.ToolPageBuilder(self,
                                runnable=False,
                                title="Utilities",
                                description="Collection of private utilities",
                                branding_text="- TMG Toolbox")

        pb.add_text_element(
            "To import, call inro.modeller.Modeller().module('%s')" %
            str(self))

        return pb.render()
    def page(self):
        pb = m.ToolPageBuilder(
            self,
            title="Export Network Tables",
            description=
            "Exports up to 5 CSV tables from the selected scenario. Table columns are limited to "
            "'standard', 'extra' and 'result' categories as defined in the Network API (so link mode "
            "codes are omitted).",
            branding_text="- TMG Toolbox")

        if self.tool_run_msg != "":  # to display messages in the page
            pb.tool_run_status(self.tool_run_msg_status)

        pb.add_select_scenario('SourceScenario',
                               title="Scenario",
                               allow_none=False)

        pb.add_select_file('TargetFolder',
                           window_type='directory',
                           title="Folder",
                           note="Folder to contain output CSVs")

        pb.add_text_box(
            'FilePrefix',
            title="File prefix",
            note=
            "Optional text to prepend to export files. Otherwise the files will be named 'links.csv', "
            "etc.")

        group_data = [{
            'attribute': 'NodeTableFlag',
            'label': 'Export node table?'
        }, {
            'attribute': 'LinkTableFlag',
            'label': 'Export link table?'
        }, {
            'attribute': 'TurnTableFlag',
            'label': 'Export turn table?'
        }, {
            'attribute': 'LineTableFlag',
            'label': 'Export transit line table?'
        }, {
            'attribute': 'SegmentTableFlag',
            'label': 'Export transit segment table?'
        }]
        pb.add_checkbox_group(
            group_data,
            title="Flags for network elements",
            note="<div id='ux_all'>Export all elements?</div>")

        return pb.render()
 def page(self):
     pb = _m.ToolPageBuilder(self, title="Check Link lanes",
                  description="Checks that special link type (centroid connectors, transit-only links) \
                              meet NCS11 requirements.<br><br> Reports any errors in the logbook.",
                  branding_text="- TMG Toolbox")
     
     if self.tool_run_msg != "": # to display messages in the page
             pb.tool_run_status(self.tool_run_msg_status)
         
     pb.add_select_scenario(tool_attribute_name="Scenario",
                            title="Select scenario",
                            allow_none=False)
     
     return pb.render()
Exemple #13
0
    def page(self):
        pb = _m.ToolPageBuilder(
            self,
            title="Network Utilities",
            branding_text="- TMG Toolbox",
            description="Collection of small functions (including \
                                a shortest-path calculator) for network editing"
        )

        pb.add_text_element(
            "To import, call inro.modeller.Modeller().module('%s')" %
            str(self))

        return pb.render()
Exemple #14
0
    def page(self):
        pb = _m.ToolPageBuilder(
            self,
            title="Convert Vehicles v%s" % self.version,
            description="Converts vehicle definitions and properties \
                                    according to NCS11 definitions.",
            branding_text="- TMG Toolbox")

        if self.tool_run_msg != "":  # to display messages in the page
            pb.tool_run_status(self.tool_run_msg_status)

        pb.add_select_scenario(tool_attribute_name="scenario",
                               title="Select scenario",
                               allow_none=False)

        return pb.render()
    def page(self):
        pb = m.ToolPageBuilder(
            self,
            title="Auxiliary Transit Distance",
            description=
            "Runs an Extended Transit Assignment on aux. transit modes only. Travel distance are then skimed into a matrix.",
            branding_text="- TMG Toolbox")
        if self.tool_run_msg != "":  # to display messages in the page
            pb.tool_run_status(self.tool_run_msg_status)

        pb.add_select_scenario("Scenario",
                               title="Scenario",
                               note="Scenario in which to run the assignment")
        pb.add_select_matrix(
            "DemandMatrixID",
            allow_none=True,
            id=True,
            title="Demand matrix",
            note="Can be blank, in which case a demand of 0 is used")
        pb.add_select("AssignmentModes",
                      keyvalues=self.populate_mode_list(),
                      title="Assignment modes")
        with pb.section("Outputs"):
            pb.add_select_matrix(
                "DistanceSkimMatrixID",
                allow_none=False,
                id=True,
                title="Distance skim matrix",
                note="If left blank, no skim matrix will be generated")
        pb.add_text_box("ClassName", title="Class name", size=50)
        pb.add_html("""
        <script type="text/javascript">
            $(document).ready( function ()
            {        
                var tool = new inro.modeller.util.Proxy(%s) ;
                $("#Scenario").bind('change', function()
                {
                    $(this).commit();
                    $("#AssignmentModes")
                        .empty()
                        .append(tool.populate_mode_list(true))
                        .trigger('change');
                });
            });
        </script>""" % pb.tool_proxy_tag)
        return pb.render()
    def page(self):
        pb = _modeller.ToolPageBuilder(
            self,
            title="BKRCast Network Interface",
            description="Update EMME database path",
            branding_text=
            "Modeling and Analysis Group -- City of Bellevue Transportation")
        pb.add_select_file("BKRCastFolder",
                           "directory",
                           "",
                           self.default_path,
                           title="Select the BKRCast folder")

        if self.tool_run_message != "":
            pb.tool_run_status(self.tool_run_msg_status)

        return pb.render()
Exemple #17
0
    def page(self):
        pb = _m.ToolPageBuilder(
            self,
            title="Renumber Nodes",
            description=
            "Re numbers non-zone nodes from NCS01 to NCS11.<br><br><b>This tool is irreversible. \
                                 Make sure to copy your scenarios prior to running!</b>",
            branding_text="- TMG Toolbox")

        if self.tool_run_msg != "":  # to display messages in the page
            pb.tool_run_status(self.tool_run_msg_status)

        pb.add_select_scenario(tool_attribute_name="Scenarios",
                               title="Select scenarios",
                               allow_none=False)

        return pb.render()
Exemple #18
0
 def page(self):
     pb = _m.ToolPageBuilder(self, title="Move Networks",
                  description="Moves selected networks up by 4,000,000 meters; essentially \
                          adding a 7th digit to the y-coordinate to make the projection \
                          compatible with UTM-17N.<br>\
                          <br><b>This tool is irreversible. Make sure to copy your \
                          scenarios prior to running!</b>",
                  branding_text="- TMG Toolbox")
     
     if self.tool_run_msg != "": # to display messages in the page
         pb.tool_run_status(self.tool_run_msg_status)
         
     pb.add_select_scenario(tool_attribute_name="Scenarios",
                            title="Select scenarios",
                            allow_none=False)
     
     return pb.render()
Exemple #19
0
    def page(self):
        pb = _m.ToolPageBuilder(
            self,
            title="Check connector speeds",
            description=
            "Checks that all connectors are set to 40 km/hr as per NCS11.<br><br>\
                                 Reports any errors in the logbook.",
            branding_text="- TMG Toolbox")

        if self.tool_run_msg != "":  # to display messages in the page
            pb.tool_run_status(self.tool_run_msg_status)

        pb.add_select_scenario(tool_attribute_name="Scenario",
                               title="Select scenario",
                               allow_none=False)

        return pb.render()
Exemple #20
0
    def page(self):
        pb = _m.ToolPageBuilder(
            self,
            title="Execute Python Script",
            description=
            "A powerful utility Tool which facilitates executing a single Python script.\
                                <br><br>All '<b>print</b>' statements get re-directed to the logbook.",
            branding_text="- TMG Toolbox")

        if self.tool_run_msg != "":  # to display messages in the page
            pb.tool_run_status(self.tool_run_msg_status)

        pb.add_select_file(tool_attribute_name="filename",
                           window_type="file",
                           title="Script:",
                           file_filter="*.py")

        return pb.render()
Exemple #21
0
 def page(self):
     pb = _m.ToolPageBuilder(self, title="Check Link Lengths",
                  description="Checks that link lengths are Euclidean as per NCS11. Does not edit \
                              the network, but reports in the logbook which links are suspect.",
                  branding_text="- TMG Toolbox")
     
     if self.tool_run_msg != "": # to display messages in the page
             pb.tool_run_status(self.tool_run_msg_status)
         
     pb.add_select_scenario(tool_attribute_name="Scenario",
                            title="Select scenario",
                            allow_none=False)
     
     pb.add_text_box(tool_attribute_name="Error",
                     size=8,
                     title="Length tolerance",
                     note="The tolerance, in meters")
     
     return pb.render()
Exemple #22
0
    def page(self):
        pb = _m.ToolPageBuilder(
            self,
            title="Check Link Types",
            description=
            "Produces a worksheet to view all link types in a scenario. It is recommended that you open the default worksheet prior to running this tool.",
            branding_text="- TMG Toolbox")

        if self.tool_run_msg != "":  # to display messages in the page
            pb.tool_run_status(self.tool_run_msg_status)

        pb.add_select_scenario(tool_attribute_name="Scenario",
                               title="Select scenario",
                               note="Select a scenario to view")

        try:
            root = os.path.dirname(_m.Modeller().desktop.project_filename())
        except Exception, e:
            root = os.path.dirname(_m.Modeller().desktop.project_file_name())
Exemple #23
0
    def page(self):
        pb = _m.ToolPageBuilder(
            self,
            title="Modify Walk Modes v%s" % self.version,
            description=
            "Adds modes 'v', 'u', and 'y' to the network, and modifies the network such that \
                                            'v' is used only on centroid connectors, 'w' is permitted on non-connector links, \
                                            and that 'y' is only used on station-centroid-connectors. Also adds walk-only reverse \
                                            links for one-way roads (such as Richmond and Adelaide).\
                                            <br><br>Assumes that rail and subway nodes are numbered according to \
                                            NCS11.\
                                            <br><br><b>This tool makes irreversible changes to your sceanrio! Be sure to back it \
                                            up before running.</b>",
            branding_text="- TMG Toolbox")

        if self.tool_run_msg != "":  # to display messages in the page
            pb.tool_run_status(self.tool_run_msg_status)

        pb.add_select_scenario(tool_attribute_name="scenario",
                               title="Select a scenario",
                               allow_none=False)

        pb.add_text_box(tool_attribute_name="stationCentroidSelector",
                        size=100,
                        title="Selector for station centroids",
                        note="Write a node selector for station centroids.\
                            <br><br>A filter for centroids will automatically \
                            be applied.",
                        multi_line=True)

        pb.add_text_box(
            tool_attribute_name="walkableRoadSelector",
            size=100,
            title="Selector for walkable road links",
            note="Write a link selector for links which permit walking. A \
                              filter for centroid connectors will automatically be \
                              applied.<br><br>\
                              This selector will also be applied for selecting \
                              walkable one-way road links.",
            multi_line=True)

        return pb.render()
Exemple #24
0
    def page(self):
        desc = 'Collection of tools working with <a href="http://pandas.pydata.org/">pandas</a>'
        pb = m.ToolPageBuilder(self,
                               runnable=False,
                               title='Utilities',
                               description=desc,
                               branding_text="- TMG Toolbox")

        pb.add_text_element(
            'To import, call inro.modeller.Modeller().module("%s")' %
            str(self))

        try:
            import pandas
        except ImportError:
            pb.add_text_element(
                '<font color="red"><b>ImportWarning:</b> Pandas library is not installed.'
            )

        return pb.render()
Exemple #25
0
    def page(self):
        pb = _m.ToolPageBuilder(
            self,
            runnable=False,
            title="Utilities",
            description=
            "Collection of tools working with <a href='http://pandas.pydata.org/'>pandas</a>",
            branding_text="- TMG Toolbox")

        pb.add_text_element(
            "To import, call inro.modeller.Modeller().module('%s')" %
            str(self))

        try:
            import pandas
        except ImportError:
            pb.add_text_element(
                "<font color='red'><b>ImportWarning:</b> Pandas library is not installed."
            )

        return pb.render()
 def page(self):
     pb = _m.ToolPageBuilder(self, title="Clean GTFS Folder v%s" %self.version,
                  description="Cleans a set of GTFS files by service ID. Filters all \
                      GTFS files except for routes, calendar, and shapes.",
                  branding_text="- TMG Toolbox")
     
     if self.tool_run_msg != "": # to display messages in the page
         pb.tool_run_status(self.tool_run_msg_status)
         
     pb.add_select_file(tool_attribute_name='GTFSFolderName', 
                        window_type='directory', title="GTFS Folder")
     
     pb.add_text_box(tool_attribute_name='ServiceIdSet',
                     size=200, title="Service Id(s)",
                     note="Comma-separated list of service IDs from the calendar.txt file",
                     multi_line=True)
     
     pb.add_select_file(tool_attribute_name='UpdatedRoutesFile', 
                        window_type='file', title="Optional Filtered Routes")
     
     return pb.render()
 def page(self):
     pb = _m.ToolPageBuilder(self, title="Check Link Types",
                  description="Produces a worksheet to view all link types in a scenario. It is recommended that you open the default worksheet prior to running this tool.",
                  branding_text="- TMG Toolbox")
     
     if self.tool_run_msg != "": # to display messages in the page
         pb.tool_run_status(self.tool_run_msg_status)
     
     pb.add_select_scenario(tool_attribute_name="Scenario",
                             title="Select scenario",
                             note="Select a scenario to view")
     
     try:
         root = os.path.dirname(_m.Modeller().desktop.project_filename())
     except Exception as e:
         root = os.path.dirname(_m.Modeller().desktop.project_file_name())
     pb.add_select_file(tool_attribute_name="WorksheetFile",
                        window_type="file",
                        file_filter="*.emw",
                        start_path=root,
                        title="Emme worksheet file",
                        note="Optional. If provided, this tool will add layers to the worksheet file selected.")
     
     return pb.render()
Exemple #28
0
    def page(self):
        pb = _m.ToolPageBuilder(
            self,
            title="Convert VDFs v%s" % self.version,
            description=
            "Converts link classification types (stored as VDF ids) from \
                                DMG2001 to NCS11.",
            branding_text="- TMG Toolbox")

        if self.tool_run_msg != "":  # to display messages in the page
            pb.tool_run_status(self.tool_run_msg_status)

        pb.add_select_scenario(tool_attribute_name="scenario",
                               title="Select a scenario",
                               allow_none=False)

        pb.add_checkbox(
            tool_attribute_name="makeChangesPermanent",
            title="Make changes permanent?",
            note=
            "If unchecked, new VDF values will be stored in link extra attribute '@vdf'."
        )

        return pb.render()
Exemple #29
0
    def page(self):
        pb = _modeller.ToolPageBuilder(
            self,
            title="BKRCast Network Interface",
            description="Populate networks from master network",
            branding_text=
            "Modeling and Analysis Group -- City of Bellevue Transportation")
        pb.add_select_file("outputFolder",
                           "directory",
                           "",
                           self.default_path,
                           title="Select the directory for output files")
        if not self.current_scen:
            self.current_scen = self.current_scenario
        pb.add_select_scenario("current_scen", title="Scenario:")
        pb.add_text_box("new_scen_id",
                        5,
                        title="Enter the new scenario ID",
                        note="Number between 1 and 99999.")
        pb.add_checkbox('overwrite_scen', title='Overwrite existing scenario?')
        pb.add_text_box("new_scen_title",
                        60,
                        title='New scenario title',
                        note='Maximum 60 characters.')
        pb.add_text_box("horizon_year",
                        4,
                        title="Enter the horizon year",
                        note="4-digit integer only")
        self.horizon_year = ''
        self.new_scen_title = str(
            self.horizon_year
        ) + ' network built from scen ' + self.current_scen.id
        if self.tool_run_message != "":
            pb.tool_run_status(self.tool_run_msg_status)

        return pb.render()
Exemple #30
0
    def page(self):
        self.load_properties()
        pb = _m.ToolPageBuilder(self)
        pb.title = "Master run ABM"
        pb.description = """Runs the SANDAG ABM, assignments, and other demand model tools."""
        pb.branding_text = "- SANDAG - Model"
        tool_proxy_tag = pb.tool_proxy_tag

        if self.tool_run_msg != "":
            pb.tool_run_status(self.tool_run_msg_status)

        pb.add_select_file('main_directory',
                           'directory',
                           title='Select main ABM directory',
                           note='')
        pb.add_text_box('scenario_id', title="Scenario ID:")
        pb.add_text_box('scenario_title', title="Scenario title:", size=80)
        pb.add_text_box('emmebank_title', title="Emmebank title:", size=60)
        dem_utils.add_select_processors("num_processors", pb, self)

        # optional username and password input for distributed assignment
        pb.add_html('''
<div class="t_element">
    <div class="t_local_title">Credentials for remote run</div>
    <div>
        <strong>Username:</strong>
        <input type="text" id="username" size="20" class="-inro-modeller"
                data-ref="parent.%(tool_proxy_tag)s.username"></input>
        <strong>Password:</strong>
        <input type="password" size="20" id="password" class="-inro-modeller"
                data-ref="parent.%(tool_proxy_tag)s.password"></input>
    </div>
    <div class="t_after_widget">
    Note: required for running distributed traffic assignments using PsExec. 
    Not used in single-node mode. <br>
    Distributed / single node modes are configured in "config/server-config.csv".
    </div>
</div>''' % {"tool_proxy_tag": tool_proxy_tag})

        # defined in properties utilities
        self.add_properties_interface(pb, disclosure=True)
        # redirect properties file after browse of main_directory
        pb.add_html("""
<script>
    $(document).ready( function ()
    {
        var tool = new inro.modeller.util.Proxy(%(tool_proxy_tag)s) ;
        $("#main_directory").bind('change', function()    {
            var path = $(this).val();
            tool.properties_path = path + "/conf/sandag_abm.properties";
            tool.load_properties();
            $("input:checkbox").each(function() {
                $(this).prop('checked', tool.get_value($(this).prop('id')) );
            });
            $("#startFromIteration").prop('value', tool.startFromIteration);
            $("#sample_rates").prop('value', tool.sample_rates);
        });
   });
</script>""" % {"tool_proxy_tag": tool_proxy_tag})

        traffic_assign = _m.Modeller().tool(
            "sandag.assignment.traffic_assignment")
        traffic_assign._add_select_link_interface(pb)

        return pb.render()