<commit_before>package org.bimserver.geometry;

/******************************************************************************
 * Copyright (C) 2009-2019  BIMserver.org
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see {@literal<http://www.gnu.org/licenses/>}.
 *****************************************************************************/

public class Density {
	private float volume;
	private long nrPrimitives;
	private long geometryInfoId;
	private String type;
	private float biggestFaceArea;

	public Density(String type, float volume, float biggestFaceArea, long nrPrimitives, long geometryInfoId) {
		this.type = type;
		this.volume = volume;
		this.biggestFaceArea = biggestFaceArea;
		this.nrPrimitives = nrPrimitives;
		this.geometryInfoId = geometryInfoId;
	}
	
	public String getType() {
		return type;
	}
	
	public long getGeometryInfoId() {
		return geometryInfoId;
	}
	
	public long getNrPrimitives() {
		return nrPrimitives;
	}
	
	public float getVolume() {
		return volume;
	}
	
	public float getDensityValue() {
		if (biggestFaceArea == 0f) {
			return 0;
		}
		float d = nrPrimitives / biggestFaceArea;
		if (d < 0) {
			// WTF
			d = 0;
		}
		return d;
	}
	
	public float getBiggestFaceArea() {
		return biggestFaceArea;
	}
}<commit_msg>Better variable naming and converted to m2 so densities don't always look like 0.000004<commit_after>package org.bimserver.geometry;

/******************************************************************************
 * Copyright (C) 2009-2019  BIMserver.org
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see {@literal<http://www.gnu.org/licenses/>}.
 *****************************************************************************/

public class Density {
	private float volume;
	private long nrPrimitives;
	private long geometryInfoId;
	private String type;
	private float biggestFaceAreaM2;

	public Density(String type, float volume, float biggestFaceAreaMm2, long nrPrimitives, long geometryInfoId) {
		this.type = type;
		this.volume = volume;
		this.biggestFaceAreaM2 = biggestFaceAreaMm2 / 1000000f;
		this.nrPrimitives = nrPrimitives;
		this.geometryInfoId = geometryInfoId;
	}
	
	public String getType() {
		return type;
	}
	
	public long getGeometryInfoId() {
		return geometryInfoId;
	}
	
	public long getNrPrimitives() {
		return nrPrimitives;
	}
	
	public float getVolume() {
		return volume;
	}
	
	public float getDensityValue() {
		if (biggestFaceAreaM2 == 0f) {
			return 0;
		}
		float d = nrPrimitives / biggestFaceAreaM2;
		if (d < 0) {
			// WTF
			d = 0;
		}
		return d;
	}
	
	public float getBiggestFaceArea() {
		return biggestFaceAreaM2;
	}
}
{'fraction_non_alphanumeric': 0.15111695137976347, 'fraction_numerical': 0.012614980289093298, 'mean_word_length': 4.157181571815718, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4257268', 'n_tokens_mistral': 1180, 'n_tokens_neox': 1032, 'n_words': 398}