<commit_before>package org.mwc.debrief.dis.diagnostics;

import java.util.Properties;

import org.mwc.debrief.dis.core.DISModule;
import org.mwc.debrief.dis.core.IDISModule;
import org.mwc.debrief.dis.diagnostics.file.CollisionFileListener;
import org.mwc.debrief.dis.diagnostics.file.DetonateFileListener;
import org.mwc.debrief.dis.diagnostics.file.EventFileListener;
import org.mwc.debrief.dis.diagnostics.file.FireFileListener;
import org.mwc.debrief.dis.diagnostics.file.FixToFileListener;
import org.mwc.debrief.dis.diagnostics.file.StartFileListener;
import org.mwc.debrief.dis.diagnostics.file.StopFileListener;
import org.mwc.debrief.dis.diagnostics.senders.NetworkPduSender;
import org.mwc.debrief.dis.listeners.IDISFixListener;
import org.mwc.debrief.dis.listeners.IDISStopListener;
import org.mwc.debrief.dis.providers.IPDUProvider;
import org.mwc.debrief.dis.providers.network.CoreNetPrefs;
import org.mwc.debrief.dis.providers.network.IDISNetworkPrefs;
import org.mwc.debrief.dis.providers.network.NetworkDISProvider;

import edu.nps.moves.dis.EntityID;

public class HeadlessDISLogger
{

  private static final int SITE_ID = 778;
  private static final int APPLICATION_ID = 777;
  private boolean _terminated = false;
  private EntityID _ourID;

  public static void main(String[] args)
  {
    // start running
    new HeadlessDISLogger(args);
  }

  public HeadlessDISLogger(String[] args)
  {

    // setup the ID
    _ourID = new EntityID();
    _ourID.setApplication((short) APPLICATION_ID);
    _ourID.setSite((short) SITE_ID);
    
    // do we have a root?
    String root = System.getProperty("java.io.tmpdir");

    // do we have an IP address?
    String address = NetworkPduSender.DEFAULT_MULTICAST_GROUP;

    // do we have a PORT?
    int port = NetworkPduSender.PORT;

    // All system properties, passed in on the command line via
    // -Dattribute=value
    Properties systemProperties = System.getProperties();
    // IP address we send to
    String destinationIpString = systemProperties.getProperty("group");
    // Port we send to, and local port we open the socket on
    String portString = systemProperties.getProperty("port");

    // Port we send to, and local port we open the socket on
    String rootString = systemProperties.getProperty("root");

    if (destinationIpString != null)
    {
      address = destinationIpString;
    }
    if (portString != null)
    {
      port = Integer.parseInt(portString);
    }
    if (rootString != null)
    {
      root = rootString;
    }

    // setup the output destinations
    boolean toFile = true;
    boolean toScreen = true;<commit_msg>allow provision of "toScreen" in script<commit_after>package org.mwc.debrief.dis.diagnostics;

import java.util.Properties;

import org.mwc.debrief.dis.core.DISModule;
import org.mwc.debrief.dis.core.IDISModule;
import org.mwc.debrief.dis.diagnostics.file.CollisionFileListener;
import org.mwc.debrief.dis.diagnostics.file.DetonateFileListener;
import org.mwc.debrief.dis.diagnostics.file.EventFileListener;
import org.mwc.debrief.dis.diagnostics.file.FireFileListener;
import org.mwc.debrief.dis.diagnostics.file.FixToFileListener;
import org.mwc.debrief.dis.diagnostics.file.StartFileListener;
import org.mwc.debrief.dis.diagnostics.file.StopFileListener;
import org.mwc.debrief.dis.diagnostics.senders.NetworkPduSender;
import org.mwc.debrief.dis.listeners.IDISFixListener;
import org.mwc.debrief.dis.listeners.IDISStopListener;
import org.mwc.debrief.dis.providers.IPDUProvider;
import org.mwc.debrief.dis.providers.network.CoreNetPrefs;
import org.mwc.debrief.dis.providers.network.IDISNetworkPrefs;
import org.mwc.debrief.dis.providers.network.NetworkDISProvider;

import edu.nps.moves.dis.EntityID;

public class HeadlessDISLogger
{

  private static final int SITE_ID = 778;
  private static final int APPLICATION_ID = 777;
  private boolean _terminated = false;
  private EntityID _ourID;

  public static void main(String[] args)
  {
    // start running
    new HeadlessDISLogger(args);
  }

  public HeadlessDISLogger(String[] args)
  {

    // setup the ID
    _ourID = new EntityID();
    _ourID.setApplication((short) APPLICATION_ID);
    _ourID.setSite((short) SITE_ID);
    
    // do we have a root?
    String root = System.getProperty("java.io.tmpdir");

    // do we have an IP address?
    String address = NetworkPduSender.DEFAULT_MULTICAST_GROUP;

    // do we have a PORT?
    int port = NetworkPduSender.PORT;

    // write to screen?
    boolean toScreen = true;

    // All system properties, passed in on the command line via
    // -Dattribute=value
    Properties systemProperties = System.getProperties();
    // IP address we send to
    String destinationIpString = systemProperties.getProperty("group");
    // Port we send to, and local port we open the socket on
    String portString = systemProperties.getProperty("port");

    // Port we send to, and local port we open the socket on
    String rootString = systemProperties.getProperty("root");
    
    // whether to write progress to screen
    String toScreenStr = systemProperties.getProperty("screen");

    if (destinationIpString != null)
    {
      address = destinationIpString;
    }
    if (portString != null)
    {
      port = Integer.parseInt(portString);
    }
    if (rootString != null)
    {
      root = rootString;
    }
    if(toScreenStr != null)
    {
      toScreen = Boolean.valueOf(toScreenStr);
    }
    

    // setup the output destinations
    boolean toFile = true;
{'fraction_non_alphanumeric': 0.09974656046343229, 'fraction_numerical': 0.002172338884866039, 'mean_word_length': 3.7303082191780823, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '6101545', 'n_tokens_mistral': 1747, 'n_tokens_neox': 1715, 'n_words': 388}