Esempio n. 1
0
   /**
    * Set probability of each initial state to 1.0 / number of used initial states for this parametrization.
    */
   void initiate() {
      exits.assign(exits.size(), 0);
      current_prob.assign(current_prob.size(), 0.);
      next_prob = current_prob;

      setInitials();
   }
Esempio n. 2
0
int
ConcreteS::recvSelf(int commitTag, Channel &theChannel, FEM_ObjectBroker &theBroker)
{
	int res = 0, cnt = 0;

	static Vector data(13);

	res = theChannel.recvVector(this->getDbTag(), commitTag, data);
	if (res < 0) {
		opserr << "ConcreteS::recvSelf -- could not recv Vector" << endln;
		return res;
	}

	this->setTag(int(data(cnt++)));
	E = data(cnt++);
	nu = data(cnt++);
	fc = data(cnt++);
	ft = data(cnt++);
	Es = data(cnt++);
	cStrain0 = data(cnt++);

	setInitials();

	int i;
	for (i = 0; i < 3; i++)
		strain0(i) = data(cnt++);

	for (i = 0; i < 3; i++)
		stress0(i) = data(cnt++);

	return res;
}
Esempio n. 3
0
//full constructor
ConcreteS::ConcreteS(int tag, double rE, double rnu, double rfc, double rft, double rEs) :
NDMaterial(tag, ND_TAG_ConcreteS),
strain0(3), strain(3), stress0(3), stress(3), stressd(3),
tangent(3, 3), eTangent(3, 3),
cStrain0(0), cStrain(0),
E(rE), nu(rnu), fc(fabs(rfc)), ft(rft), Es(fabs(rEs))
{
	setInitials();
}
Esempio n. 4
0
   /**
    * Function that computes robustness values for each parametrization.
    */
   void compute(const SynthesisResults & results, const vector<pair<StateID,StateID> > & transitions, const CheckerSettings & _settings) {
      settings = _settings;
      initiate();
      computeExits(transitions);

      // Assign probabilites for the initial states
      setInitials();

      // Cycle through the levels of the DFS procedure
      for (size_t round_num = 0; round_num < results.getUpperBound(); round_num++) {
         // Copy the data from the previous round.
         current_prob = next_prob;
         next_prob.assign(next_prob.size(), 0.);

         // For the parametrization cycle through transitions
         for (const auto & trans:transitions) {
            size_t divisor = exits[trans.first]; // Count succesor
            // Add probabilities
            if (divisor)
               next_prob[trans.second] += current_prob[trans.first] / divisor ;
         }
      }
   }
Esempio n. 5
0
/* Add all the models to be created here */
void initGL (GLFWwindow* window, int width, int height)
{
  
for(int i=0;i<STATIC_OBSTACLES - 1;i++){
   setInitials(obstacles[i],0.698039, 0.133333, 0.133333);
  }
     setInitials(obstacles[5],0.721569, 0.52549, 0.0431373);


  GLfloat * hinge_vertices = circleVertices(borders[0][0]->num_vertices, borders[0][0]->radius);
  GLfloat * hinge_colors = circleColors(borders[0][0]->num_vertices,0.698039, 0.133333, 0.133333);
for(int j=0;j<BORDERS;j++){
  for(int i=0;i<4;i++){
    borders[j][i]->setInitVertices(hinge_vertices);
    borders[j][i]->setInitColors(hinge_colors);
    borders[j][i]->createCircle();
  }
}
hinge_colors = circleColors(borders[0][0]->num_vertices,0.662745, 0.662745, 0.662745);
 hinge->setInitVertices(hinge_vertices);
  hinge->setInitColors(hinge_colors);
  hinge->createCircle();

hinge_vertices = circleVertices(jumper->num_vertices,jumper->radius);
hinge_colors  = circleColors(jumper->num_vertices,0.466667, 0.533333, 0.6);
jumper->setInitVertices(hinge_vertices);
jumper->setInitColors(hinge_colors);
jumper->createCircle();
/*for (int i = 0; i < ATTEMPT; ++i)
{
  attempt[i]->setInitVertices(hinge_vertices);
    attempt[i]->setInitColors(hinge_colors);
    attempt[i]->createCircle();
}
*/
GLfloat * circle_vertices , * circle_colors;
for(int i=0;i<CIRCLE;i++){
  circle_vertices = circleVertices(back_circles[i]->num_vertices,back_circles[i]->radius);
  circle_colors = circleColors(back_circles[i]->num_vertices,1,1,1);
  back_circles[i]->setInitVertices(circle_vertices);
    back_circles[i]->setInitColors(circle_colors);
    back_circles[i]->createCircle();
}

for(int i=0;i<BALL_CIRCLES;i++){
  circle_vertices = circleVertices(ball_circles[i]->num_vertices,ball_circles[i]->radius);
  circle_colors = circleColors(ball_circles[i]->num_vertices,1, 0.54902, 0);
  ball_circles[i]->setInitVertices(circle_vertices);
    ball_circles[i]->setInitColors(circle_colors);
    ball_circles[i]->createCircle();
    ball_fill_circles[i]->setInitVertices(circle_vertices);
    ball_fill_circles[i]->setInitColors(circle_colors);
    ball_fill_circles[i]->createCircle();
}

setInitials(canon,1, 0.870588, 0.678431);
  setInitials(base,0, 0, 0.501961);

  setInitials(tar,0.8,0.1,0);

  for(int i=0;i<=10;i++){
      setInitials(bar[i],float(i)/10,1-float(i)/10,0);
  }

  GLfloat button_base_vertices[] = {
    0,0,0,
    0,0.8,0,
    1.5,1.25,0,

    1.5,1.25,0,
    1.5,-0.45,0,
    0,0,0

  } ;

  GLfloat * colors = button_base->getInitColors(0.741176, 0.717647, 0.419608);
  button_base->setInitVertices(button_base_vertices);
  button_base->setInitColors(colors);
  button_base->createRectangle();

  GLfloat back_floor_vertices[]={
    -10,-4,0,
    -9,4,0,
    10,4,0,

    10,4,0,
    10,-4,0,
    -10,-4,0,

  };

  colors = back_floor->getInitColors(0.721569, 0.52549, 0.0431373);
  back_floor->setInitVertices(back_floor_vertices);
  back_floor->setInitColors(colors);
  back_floor->createRectangle();

 GLfloat back_line1[]={
   -0.25,-4,0,
    0,4,0,
    0.25,4,0,

    0.25,4,0,
    0,-4,0,
    -0.25,-4,0,
  };
  setInitials(back_lines[0],1, 1, 0.941176,back_line1);

  for(int i = 0 ;i<PAINT;i++){
    setInitials(paint[i],1, 1, 0.941176);
  }
 /* GLfloat back_line2[]={
    -8,-2,0,
    -8.3,-1.7,0,
    -4,-0.7,0,
    
    -4,-0.7,0,
    -3.7,-1,0,
    -8,-2,0,
  };
  setInitials(back_lines[1],1, 1, 0.941176,back_line2);*/


  setInitials(button,0.862745, 0.0784314, 0.235294);

  for(int i=0;i<LINES;i++)
    setInitials(lines[i],1,1,1);

	// Create and compile our GLSL program from the shaders
	programID = LoadShaders( "Sample_GL.vert", "Sample_GL.frag" );
	// Get a handle for our "MVP" uniform
	Matrices.MatrixID = glGetUniformLocation(programID, "MVP");

	
	reshapeWindow (window, width, height);

    // Background color of the scene
	glClearColor ( 1, 0.980392, 0.803922 ,0.f); // R, G, B, A
	glClearDepth (1.0f);

	glEnable (GL_DEPTH_TEST);
	glDepthFunc (GL_LEQUAL);

   
}