Exemplo n.º 1
0
def i2_step1_evaluator(root1, e1):
    set_step(step1_name)
    wrap_evaluator(e1, root=root1)
Exemplo n.º 2
0
def i2_step2_evaluator(root2, e2):
    set_step(step2_name)
    wrap_evaluator(e2, root=root2)
 def process_evaluator():
     wrap_evaluator(E, root=root)
Exemplo n.º 4
0
                              cwd='/',
                              stderr=sys.stderr,
                              stdout=sys.stdout)
        cie.set_evaluation_file('report.pdf', '/report.pdf')

        files = [
            'aidoScores1and2Intg.png',
            'aidoScores1and2Diff.png',
            'numberCustomersPlot.png',
            'requestsPerDriveTime.png',
            'requestsPerTotalTravelTime.png',
            'requestsPerWaitTime.png',
            'statusDistribution.png',
            'occAndDistRatios.png',
            'stackedDistance.png',
            'distanceDistribution.png',
            'binnedWaitingTimes.png',
            'aidoScoresIntg/aidoScoresIntg.csv',
            'aidoScoresIncr/aidoScoresIncr.csv',
        ]

        for fn in files:
            full = os.path.join('/amod/target/output/001/data', fn)
            cie.set_evaluation_file(os.path.basename(fn), full)

        cie.set_score('passed', True)


if __name__ == '__main__':
    wrap_evaluator(Evaluator())
Exemplo n.º 5
0
    # will be started in Submission Container

    # submission.run() is done
    # we run score() in Evaluation Container (this container)
    def score(self, cie):
        assert isinstance(cie, dc.ChallengeInterfaceEvaluator)

        cie.info('waiting for gym to finish')
        self.gym_process.wait()
        cie.info('finished with return code %s' % self.gym_process.returncode)
        if self.gym_process.returncode:
            msg = 'Gym exited with code %s' % self.gym_process.returncode
            raise dc.InvalidEvaluator(msg)

        cie.set_score('simulation', '1.0')

        set_evaluation_dir(cie, 'episodes', self.logdir)


def set_evaluation_dir(cie, basename, realdir):
    for bn in os.listdir(realdir):
        fn = os.path.join(realdir, bn)
        if os.path.isdir(fn):
            set_evaluation_dir(cie, os.path.join(basename, bn), fn)
        else:
            cie.set_evaluation_file(os.path.join(basename, bn), fn)


if __name__ == '__main__':
    dc.wrap_evaluator(GymEvaluator())
Exemplo n.º 6
0
 def step2_evaluator():
     set_step(step2_name)
     wrap_evaluator(E2, root=root2)
Exemplo n.º 7
0
 def step1_evaluator():
     set_step(step1_name)
     wrap_evaluator(E1, root=root1)