Beispiel #1
0
//==============================================================================
double VoxelGridShape::getOccupancy(const Eigen::Vector3d& point) const
{
  const auto node = mOctree->search(point.x(), point.y(), point.z());
  if (node)
    return node->getOccupancy();
  else
    return 0.0;
}
/**
 * Calculates the structure factor
 *
 * This method calculates the structure factor.
 * For details, please refer to the class documentation in the header file.
 *
 * @param hkl :: HKL for which the structure factor should be calculated
 * @return Structure factor (complex).
 */
StructureFactor
IsotropicAtomBraggScatterer::calculateStructureFactor(const V3D &hkl) const {
    double amplitude =
        getOccupancy() * getDebyeWallerFactor(hkl) * getScatteringLength();

    double phase = 2.0 * M_PI * m_position.scalar_prod(hkl);

    return amplitude * StructureFactor(cos(phase), sin(phase));
}
Beispiel #3
0
GUIParameterTableWindow*
GUIParkingArea::getParameterWindow(GUIMainWindow& app,
                                     GUISUMOAbstractView&) {
    GUIParameterTableWindow* ret =
        new GUIParameterTableWindow(app, *this, 4);
    // add items
    ret->mkItem("begin position [m]", false, myBegPos);
    ret->mkItem("end position [m]", false, myEndPos);
    ret->mkItem("occupancy [#]", true, getOccupancy());
    ret->mkItem("capacity [#]", false, getCapacity());
    // close building
    ret->closeBuilding();
    return ret;
}
Beispiel #4
0
/*
 * *	Fonction de decodage d une mesure de presence
 **	Si la nouvelle valeur est differente de l ancienne, elle est mise a jour, et celle-ci est reporte dans un fichier de log.
 **	Renvoie 0 si un changement de valeur a eu lieu, 1 sinon.
 */
int decodeMessageOccupancy(char* message, struct Sensor* p_sensor) {
	int occupancy;
	occupancy = getOccupancy(message);
	#if DEBUG > 0
	if (occupancy == 1) {
		printf("Aucune presence detectee. \n");
	} else {
		printf("Presence detectee. \n");
	}
	#endif
	/* Si la nouvelle valeur est differente de l ancienne */
	if (occupancy != p_sensor->value) {
		p_sensor->value = occupancy;
		printf("[ComponentInterface] Nouvelle valeur pour le capteur de présence, ID : %s; valeur : %f \n", p_sensor->id, p_sensor->value);
		gLogsLog(p_sensor->id, p_sensor->value);		
		return VALUE_CHANGE;
	}
	return NO_CHANGE;
}
Beispiel #5
0
SUMOReal
GUIEdge::getColorValue(size_t activeScheme) const {
    switch (activeScheme) {
        case 1:
            return gSelected.isSelected(getType(), getGlID());
        case 2:
            return getPurpose();
        case 3:
            return getAllowedSpeed();
        case 4:
            return getOccupancy();
        case 5:
            return getMeanSpeed();
        case 6:
            return getFlow();
        case 7:
            return getRelativeSpeed();
    }
    return 0;
}
void SmartCrawler::onSpawn(){
    //m_map->gridOccupancy[oldPos.x][oldPos.y][oldPos.z] += occupancy;
    m_map->gridOccupancy[newPos.x][newPos.y][newPos.z] += getOccupancy();
}