4956dc485f78ef2b7c5f4a13f8abb7a24cfbb1bb,flow/scenarios/highway/gen.py,HighwayGenerator,specify_nodes,#HighwayGenerator#Any#,20

Before Change


        See parent class.
        length = net_params.additional_params["length"]

        nodes = [{
            "id": "begin",
            "x": repr(0),
            "y": repr(0)
        }, {
            "id": "end",
            "x": repr(length),
            "y": repr(0)
        }]

        return nodes

    def specify_edges(self, net_params):

After Change


    def specify_nodes(self, net_params):
        See parent class.
        length = net_params.additional_params["length"]
        num_edges = net_params.additional_params.get("length", 1)
        segment_lengths = np.linspace(0, length, num_edges+1)[1:]

        nodes = []
        for i in range(num_edges):
            nodes += [{
                "id": "begin_{}".format(i),
                "x": repr(segment_lengths[i]),
                "y": repr(segment_lengths[i])
            }, {
                "id": "end_{}".format(i),
                "x": repr(segment_lengths[i+1]),
                "y": repr(segment_lengths[i+1])
            }]

        return nodes

    def specify_edges(self, net_params):
        See parent class.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: flow-project/flow
Commit Name: 4956dc485f78ef2b7c5f4a13f8abb7a24cfbb1bb
Time: 2018-09-16
Author: vinitsky.eugene@gmail.com
File Name: flow/scenarios/highway/gen.py
Class Name: HighwayGenerator
Method Name: specify_nodes


Project Name: OpenMined/Grid
Commit Name: 92bb41035940965a436897f16294b6b563117efc
Time: 2021-02-21
Author: ionesiojr@gmail.com
File Name: apps/domain/src/main/core/services/infra_service.py
Class Name:
Method Name: get_workers_msg


Project Name: flow-project/flow
Commit Name: 67f6d47d9e61f28d455319c868c38fbc11e73366
Time: 2018-02-22
Author: eugenevinitsky@wirelessprvnat-172-16-134-167.near.illinois.edu
File Name: flow/scenarios/bridge_toll/gen.py
Class Name: BBTollGenerator
Method Name: specify_connections