tgff

package module
v0.0.0-...-2ba5c05 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2016 License: MIT Imports: 7 Imported by: 1

README

Task Graphs For Free Build Status

The package provides a parser for the TGFF (Task Graphs For Free) format, which is a format for storing task graphs and accompanying data used in scheduling and allocation research. Refer to TGFF for further details.

Documentation

Contributing

  1. Fork the project.
  2. Implement your idea.
  3. Open a pull request.

Documentation

Overview

Package tgff provides a parser for the TGFF (Task Graphs For Free) format, which is a format for storing task graphs and accompanying data used in scheduling and allocation research.

http://ziyang.eecs.umich.edu/~dickrp/tgff

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arc

type Arc struct {
	Name string
	From string
	To   string
	Type uint
}

Arc is a ARC entry of a graph.

type Column

type Column struct {
	Name string
	Data []float64
}

Column is a column of a table.

type Deadline

type Deadline struct {
	Name string
	On   string
	At   uint
}

Deadline is a HARD_DEADLINE entry of a graph.

type Graph

type Graph struct {
	Name      string
	ID        uint
	Period    uint
	Tasks     []Task
	Arcs      []Arc
	Deadlines []Deadline // Hard deadlines
}

Graph represents a graph in a TGFF file.

type Result

type Result struct {
	Period uint // Hyperperiod

	Graphs []Graph
	Tables []Table
}

Result is a representation of a TGFF file.

func Parse

func Parse(reader io.Reader) (Result, error)

Parse reads the content of a TGFF file (*.tgff), generated by the tgff command-line tool from a TGFFOPT file (*.tgffopt), and returns its representation in a Result struct.

func ParseFile

func ParseFile(path string) (Result, error)

ParseFile works exactly as Parse but takes a path to a TGFF file instead of an io.Reader.

Example
result, _ := ParseFile("fixtures/simple.tgff")

fmt.Println("Task graphs:", len(result.Graphs))
fmt.Println("Data tables:", len(result.Tables))
Output:

Task graphs: 5
Data tables: 3

type Table

type Table struct {
	Name       string
	ID         uint
	Attributes map[string]float64
	Columns    []Column
}

Table represents a table in a TGFF file.

type Task

type Task struct {
	Name string
	Type uint
}

Task is a TASK entry of a graph.