accasim.experimentation.schedule_parser module

MIT License

Copyright (c) 2017 cgalleguillosm

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

class accasim.experimentation.schedule_parser.ScheduleParser(regexp, updater=[])[source]

Bases: accasim.utils.reader_class.WorkloadParserBase

This class can read and parse schedule files produced by different sources, by personalizing the underlying parser object.

ScheduleParser class is an implementation of the accasim.utils.reader_class.WorkloadParserBase

parse_line(line)[source]

This method performs parsing over a single line in the schedule file, and returns a corresponding dict object.

Parameters:line – The line that must be parsed
Returns:A dict object is successful, None otherwise
class accasim.experimentation.schedule_parser.WorkloadFileReader(workload, reg_exp, tweak_class, updater=[])[source]

Bases: object

Class that allows to read and parse schedule files produced by various sources.

This class employs a ScheduleParser object in order to parse the lines that are read from the schedule file.

next(omit_startwith=';')[source]

Reads and parses one line from the workload file that is being read.

Parameters:omit_startwith – All lines starting with this character are skipped, and not returned
Returns:A dictionary corresponding to the read line
accasim.experimentation.schedule_parser.define_result_parser(simulator_config=None)[source]

This function creates a ScheduleParser instance enabled for parsing AccaSim schedule files.

The objects produced by this function are used for post-processing simulation results.

Returns:A ScheduleParser object