Example #1
0
int
plan9_cmd(File *f, Cmd *cp)
{
	plan9(f, cp->cmdc, cp->ctext, nest);
	return TRUE;
}
Example #2
0
File: xec.c Project: deadpixi/sam
bool
plan9_cmd(File *f, Cmd *cp)
{
    plan9(f, cp->cmdc, cp->ctext, nest);
    return true;
}
Example #3
0
void skyline_cluster_test()
{
	std::cout << "2 dimensional Skyline started - Cluster Distribution Test" << std::endl;

	// generate sample costs
	std::vector<double> costs_plan1;
	boost::any any_plan1 = 1;
	costs_plan1.push_back(34);
	costs_plan1.push_back(0.4);
	std::pair<std::vector<double>, boost::any > plan1 (costs_plan1, any_plan1);

	std::vector<double> costs_plan2;
	boost::any any_plan2 = 2;
	costs_plan2.push_back(36.7);
	costs_plan2.push_back(0.7);
	std::pair<std::vector<double>, boost::any > plan2 (costs_plan2, any_plan2);

	std::vector<double> costs_plan3;
	boost::any any_plan3 = 9;
	costs_plan3.push_back(31);
	costs_plan3.push_back(0.7);
	std::pair<std::vector<double>, boost::any > plan3 (costs_plan3, any_plan3);

	std::vector<double> costs_plan4;
	boost::any any_plan4 = 4;
	costs_plan4.push_back(33.3);
	costs_plan4.push_back(1.79);
	std::pair<std::vector<double>, boost::any > plan4 (costs_plan4, any_plan4);

	std::vector<double> costs_plan5;
	boost::any any_plan5 = 5;
	costs_plan5.push_back(29);
	costs_plan5.push_back(1.1);
	std::pair<std::vector<double>, boost::any > plan5 (costs_plan5, any_plan5);

	std::vector<double> costs_plan6;
	boost::any any_plan6 = 6;
	costs_plan6.push_back(36.5);
	costs_plan6.push_back(1.25);
	std::pair<std::vector<double>, boost::any > plan6 (costs_plan6, any_plan6);

	std::vector<double> costs_plan7;
	boost::any any_plan7 = 7;
	costs_plan7.push_back(34);
	costs_plan7.push_back(1.25);
	std::pair<std::vector<double>, boost::any > plan7 (costs_plan7, any_plan7);

	std::vector<double> costs_plan8;
	boost::any any_plan8 = 8;
	costs_plan8.push_back(30.7);
	costs_plan8.push_back(1.35);
	std::pair<std::vector<double>, boost::any > plan8 (costs_plan8, any_plan8);

	std::vector<double> costs_plan9;
	boost::any any_plan9 = 9;
	costs_plan9.push_back(33.3);
	costs_plan9.push_back(1.39);
	std::pair<std::vector<double>, boost::any > plan9 (costs_plan9, any_plan9);

	std::vector<double> costs_plan10;
	boost::any any_plan10 = 10;
	costs_plan10.push_back(19);
	costs_plan10.push_back(1.9);
	std::pair<std::vector<double>, boost::any > plan10 (costs_plan10, any_plan10);

	std::vector<double> costs_plan11;
	boost::any any_plan11 = 11;
	costs_plan11.push_back(21.9);
	costs_plan11.push_back(2.3);
	std::pair<std::vector<double>, boost::any > plan11 (costs_plan11, any_plan11);

	std::vector<double> costs_plan12;
	boost::any any_plan12 = 12;
	costs_plan12.push_back(17);
	costs_plan12.push_back(2.25);
	std::pair<std::vector<double>, boost::any > plan12 (costs_plan12, any_plan12);

	std::vector<double> costs_plan13;
	boost::any any_plan13 = 13;
	costs_plan13.push_back(13.2);
	costs_plan13.push_back(2.25);
	std::pair<std::vector<double>, boost::any > plan13 (costs_plan13, any_plan13);

	std::vector<double> costs_plan14;
	boost::any any_plan14 = 14;
	costs_plan14.push_back(23.8);
	costs_plan14.push_back(2.85);
	std::pair<std::vector<double>, boost::any > plan14 (costs_plan14, any_plan14);

	std::vector<double> costs_plan15;
	boost::any any_plan15 = 15;
	costs_plan15.push_back(21.2);
	costs_plan15.push_back(2.75);
	std::pair<std::vector<double>, boost::any > plan15 (costs_plan15, any_plan15);

	std::vector<double> costs_plan16;
	boost::any any_plan16 = 16;
	costs_plan16.push_back(16);
	costs_plan16.push_back(2.75);
	std::pair<std::vector<double>, boost::any > plan16 (costs_plan16, any_plan16);

	std::vector<double> costs_plan17;
	boost::any any_plan17 = 17;
	costs_plan17.push_back(18.7);
	costs_plan17.push_back(3.09);
	std::pair<std::vector<double>, boost::any > plan17 (costs_plan17, any_plan17);

	std::vector<double> costs_plan18;
	boost::any any_plan18 = 18;
	costs_plan18.push_back(12);
	costs_plan18.push_back(2.9);
	std::pair<std::vector<double>, boost::any > plan18 (costs_plan18, any_plan18);

	std::vector<double> costs_plan19;
	boost::any any_plan19 = 19;
	costs_plan19.push_back(14);
	costs_plan19.push_back(3.2);
	std::pair<std::vector<double>, boost::any > plan19 (costs_plan19, any_plan19);

	std::vector<double> costs_plan20;
	boost::any any_plan20 = 20;
	costs_plan20.push_back(16.2);
	costs_plan20.push_back(3.4);
	std::pair<std::vector<double>, boost::any > plan20 (costs_plan20, any_plan20);

	std::vector<double> costs_plan21;
	boost::any any_plan21 = 21;
	costs_plan21.push_back(18.3);
	costs_plan21.push_back(3.6);
	std::pair<std::vector<double>, boost::any > plan21 (costs_plan21, any_plan21);

	std::vector<double> costs_plan22;
	boost::any any_plan22 = 22;
	costs_plan22.push_back(6);
	costs_plan22.push_back(4.75);
	std::pair<std::vector<double>, boost::any > plan22 (costs_plan22, any_plan22);

	std::vector<double> costs_plan23;
	boost::any any_plan23 = 23;
	costs_plan23.push_back(8);
	costs_plan23.push_back(4.8);
	std::pair<std::vector<double>, boost::any > plan23 (costs_plan23, any_plan23);

	std::vector<double> costs_plan24;
	boost::any any_plan24 = 24;
	costs_plan24.push_back(4);
	costs_plan24.push_back(4.85);
	std::pair<std::vector<double>, boost::any > plan24 (costs_plan24, any_plan24);

	std::vector<double> costs_plan25;
	boost::any any_plan25 = 25;
	costs_plan25.push_back(10.3);
	costs_plan25.push_back(5.2);
	std::pair<std::vector<double>, boost::any > plan25 (costs_plan25, any_plan25);

	std::vector<double> costs_plan26;
	boost::any any_plan26 = 26;
	costs_plan26.push_back(8);
	costs_plan26.push_back(5.25);
	std::pair<std::vector<double>, boost::any > plan26 (costs_plan26, any_plan26);

	std::vector<double> costs_plan27;
	boost::any any_plan27 = 27;
	costs_plan27.push_back(5.5);
	costs_plan27.push_back(5.3);
	std::pair<std::vector<double>, boost::any > plan27 (costs_plan27, any_plan27);

	std::vector<double> costs_plan28;
	boost::any any_plan28 = 28;
	costs_plan28.push_back(3.2);
	costs_plan28.push_back(5.3);
	std::pair<std::vector<double>, boost::any > plan28 (costs_plan28, any_plan28);

	std::vector<double> costs_plan29;
	boost::any any_plan29 = 29;
	costs_plan29.push_back(10);
	costs_plan29.push_back(5.6);
	std::pair<std::vector<double>, boost::any > plan29 (costs_plan29, any_plan29);

	std::vector<double> costs_plan30;
	boost::any any_plan30 = 30;
	costs_plan30.push_back(7.2);
	costs_plan30.push_back(5.7);
	std::pair<std::vector<double>, boost::any > plan30 (costs_plan30, any_plan30);

	std::vector<double> costs_plan31;
	boost::any any_plan31 = 31;
	costs_plan31.push_back(5.1);
	costs_plan31.push_back(5.75);
	std::pair<std::vector<double>, boost::any > plan31 (costs_plan31, any_plan31);

	std::vector<double> costs_plan32;
	boost::any any_plan32 = 32;
	costs_plan32.push_back(2);
	costs_plan32.push_back(5.6);
	std::pair<std::vector<double>, boost::any > plan32 (costs_plan32, any_plan32);

	std::vector<double> costs_plan33;
	boost::any any_plan33 = 33;
	costs_plan33.push_back(8);
	costs_plan33.push_back(6.2);
	std::pair<std::vector<double>, boost::any > plan33 (costs_plan33, any_plan33);

	std::vector<double> costs_plan34;
	boost::any any_plan34 = 34;
	costs_plan34.push_back(4.5);
	costs_plan34.push_back(6.4);
	std::pair<std::vector<double>, boost::any > plan34 (costs_plan34, any_plan34);

	std::vector<std::pair<std::vector<double>, boost::any > > test_vector;
	test_vector.push_back( plan1 );
	test_vector.push_back( plan2 );
	test_vector.push_back( plan3 );
	test_vector.push_back( plan4 );
	test_vector.push_back( plan5 );
	test_vector.push_back( plan6 );
	test_vector.push_back( plan7 );
	test_vector.push_back( plan8 );
	test_vector.push_back( plan9 );
	test_vector.push_back( plan10 );
	test_vector.push_back( plan11 );
	test_vector.push_back( plan12 );
	test_vector.push_back( plan13 );
	test_vector.push_back( plan14 );
	test_vector.push_back( plan15 );
	test_vector.push_back( plan16 );
	test_vector.push_back( plan17 );
	test_vector.push_back( plan18 );
	test_vector.push_back( plan19 );
	test_vector.push_back( plan20 );
	test_vector.push_back( plan21 );
	test_vector.push_back( plan22 );
	test_vector.push_back( plan23 );
	test_vector.push_back( plan24 );
	test_vector.push_back( plan25 );
	test_vector.push_back( plan26 );
	test_vector.push_back( plan27 );
	test_vector.push_back( plan28 );
	test_vector.push_back( plan29 );
	test_vector.push_back( plan30 );
	test_vector.push_back( plan31 );
	test_vector.push_back( plan32 );
	test_vector.push_back( plan33 );
	test_vector.push_back( plan34 );

	std::cout << "Generated sample costs" << std::endl;

	skyline *sky = new skyline();
	sky->get_skyline( test_vector );

	std::cout << "Skyline finished" << std::endl;
	std::cout << "The pareto front is: " << std::endl;
	sky->print_pareto_set();

	std::cout << std::endl;
	std::cout << std::endl;
}