Esempio n. 1
0
LevelCube2::LevelCube2(float x, float y, float z){
	num_triangles = 12;
	num_vertices = 8;

	Vertices = new Vertex[num_vertices];
	Indexes = new GLushort[num_triangles * 3];
	Colours = new RGBA[num_vertices];

	buildBufferArrays();
	buildColourArray();

	bbox.reset();
	bbox = shared_ptr<BoundingBox>(new BoundingBox(Point3(x, y, z), 1.0, 1.0, 1.0));
	makeResources();
}
Esempio n. 2
0
int main() {
    table tList;

    // Create table of events
    tList = createTable(NUMTASKS, NUMRES, OVERHEAD);

    // populateTask(tList.tasks, "name", run, per);
    // must be done from smallest to largest period
    populateTask(tList.tasks, "Compute Altitude Data", 1300, 2560);
    populateTask(tList.tasks + 1, "Compute Velocity Data", 4700, 40960);
    populateTask(tList.tasks + 2, "Compose Altitude Message", 9000, 61440);
    populateTask(tList.tasks + 3, "Display Data", 23000, 1000000);
    populateTask(tList.tasks + 4, "Compose Navigation Message", 38300, 1024000);
    populateTask(tList.tasks + 5, "Compute Position Data", 3000, 1280000);

    // Resources
    makeResources(&tList);

    // fillResource(&tList, task, res, useTime);
    fillResource(&tList, 0, 0, 200);
    fillResource(&tList, 0, 1, 0);
    fillResource(&tList, 1, 0, 200);
    fillResource(&tList, 1, 1, 0);
    fillResource(&tList, 2, 0, 150);
    fillResource(&tList, 2, 1, 3000);
    fillResource(&tList, 3, 0, 300);
    fillResource(&tList, 3, 1, 0);
    fillResource(&tList, 4, 0, 300);
    fillResource(&tList, 4, 1, 6000);
    fillResource(&tList, 5, 0, 200);
    fillResource(&tList, 5, 1, 0);

    // Blocking
    calculateBlocking(&tList);

    // Print table
    displayTable(&tList);

    // RMA algorithm
    if (rma(tList))
        printf("\nAll tasks schedulable!\n\n");

    return 0;
}