Skip to content

Commit

Permalink
Release 1.0 of hmn-core
Browse files Browse the repository at this point in the history
  • Loading branch information
Vegard Engen committed Jun 13, 2017
1 parent 609b993 commit 8691d75
Show file tree
Hide file tree
Showing 21 changed files with 2,966 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target/
27 changes: 27 additions & 0 deletions IPR.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Intellectual Property Rights (IPR) Specification

## IPR for the hmn-core software

This software distribution is licensed under the terms found in the file:

``licences/LGPL_v2.1.txt``

The IT Innovation software is the source code and the following associated jars

hmn-core-<version>.jar
hmn-core-<version>-sources.jar


# IPR for third party libraries

The hmn-core software requires various third-party libraries to compile
and/or execute. These libraries and their associated licences are detailed
below.

## LGPL

ch.qos.logback:logback-classic:1.1.1

## MIT Licence

org.slf4j:slf4j-api:1.6.1
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# HUMANE Core HMN Model (hmn-core)

This project provides a Java implementation of the Core HMN Model developed in the
HUMANE project by the University of Southampton IT Innovation Centre http://www.it-innovation.soton.ac.uk/.

The Core HMN Model was developed to support the modelling and simulation of
Human-Machine Networks. This model reflects key aspects of HMNs captured in the
HUMANE typology to describe the actors, their interactions and structure of the network.

Further details about the HUMANE project, typology and simulation
modelling work can be found on: https://humane2020.eu.

# Copyright

The source code in this distribution is (c) Copyright University of Southampton
IT Innovation Centre, 2017.

# Licences

The source code for hmn-core is provided under the LGPL v2.1; the licence
agreement for this can be found in the LICENSE file and folder named 'licences'.

A complete list of licences for this software and associated third party
software can be found in the IPR.md file.

# Software Dependencies

The following 3rd party software is required:

* Java 1.8
* Maven 3.x

## Setting up Java and Maven

Please refer to the respective software provider's instructions:

* Java JDK: http://www.oracle.com/technetwork/java/javase/downloads/index.html
* Maven: http://maven.apache.org/download.cgi

# Building the hmn-core software

This software requires maven 3.x to build, which you can do with the follow command:

```
mvn install
```

To generate JavaDoc, the package profile must be used when compiling the code:

```
mvn install -P package
```

The JavaDoc will be created in ./target/javadoc

502 changes: 502 additions & 0 deletions licenses/LGPL_v2.1.txt

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions licenses/MIT_(Newtonsoft).txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Copyright (c) 2007 James Newton-King

Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be included in all copies
or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
124 changes: 124 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>uk.ac.soton.itinnovation.hmncore</groupId>
<artifactId>hmn-core</artifactId>
<version>1.0</version>
<packaging>jar</packaging>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<hmncore.java.version>1.8</hmncore.java.version>
<hmncore.maven.compiler>3.6.1</hmncore.maven.compiler>
<hmncore.maven.resource>3.0.2</hmncore.maven.resource>
<hmncore.maven.source>3.0.1</hmncore.maven.source>
<hmncore.junit.version>4.12</hmncore.junit.version>
<hmncore.logback.version>1.2.1</hmncore.logback.version>
<hmncore.javadocplugin.version>2.10.4</hmncore.javadocplugin.version>
<hmncore.javadocpath>target/javadoc</hmncore.javadocpath>
</properties>

<build>
<plugins>

<!-- Java version-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${hmncore.maven.compiler}</version>
<configuration>
<source>${hmncore.java.version}</source>
<target>${hmncore.java.version}</target>
</configuration>
</plugin>

<!-- Plug-in to build the project with UTF-8 encoding -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${hmncore.maven.resource}</version>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>

<!-- Plug-in to generate sources jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${hmncore.maven.source}</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>compile</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>

</build>

<profiles>
<profile>
<id>package</id>
<build>
<plugins>

<!-- Package JavaDoc -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${hmncore.javadocplugin.version}</version>
<executions>
<execution>
<id>attach-javadocs</id>
<phase>package</phase>
<goals>
<goal>aggregate</goal>
</goals>

<configuration>
<reportOutputDirectory>${hmncore.javadocpath}</reportOutputDirectory>
<destDir>.</destDir>
</configuration>

</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<dependencies>

<!-- Testing -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${hmncore.junit.version}</version>
<scope>test</scope>
</dependency>

<!-- Logging -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${hmncore.logback.version}</version>
</dependency>

</dependencies>

<licenses>
<license>
<name>LGPL 2.1</name>
<url>http://www.gnu.org/licenses/lgpl-2.1.htm</url>
</license>
</licenses>

</project>

52 changes: 52 additions & 0 deletions src/main/java/uk/ac/soton/itinnovation/hmncore/Agent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/////////////////////////////////////////////////////////////////////////
//
// © University of Southampton IT Innovation Centre, 2017
//
// Copyright in this software belongs to University of Southampton
// IT Innovation Centre of Gamma House, Enterprise Road,
// Chilworth Science Park, Southampton, SO16 7NS, UK.
//
// This software may not be used, sold, licensed, transferred, copied
// or reproduced in whole or in part in any manner or form or in or
// on any media by any person other than in accordance with the terms
// of the Licence Agreement supplied with the software, or otherwise
// without the prior written consent of the copyright owners.
//
// This software is distributed WITHOUT ANY WARRANTY, without even the
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE, except where stated in the Licence Agreement supplied with
// the software.
//
// Created By : Vegard Engen
// Created Date : 2017-02-02
// Created for Project : HUMANE
//
/////////////////////////////////////////////////////////////////////////
package uk.ac.soton.itinnovation.hmncore;

import java.io.Serializable;

/**
* An abstract class representing an Agent in the HMN. At the core level, this can
* be either a Human or a Machine.
* @see Human
* @see Machine
* @author Vegard Engen
*/
public abstract class Agent extends Node implements Serializable
{
/**
* Default constructor.
*/
public Agent()
{

}

/**
* Abstract method that should be implemented by actors in a simulated
* environment for a HMN, which should be invoked during the course of a simulation.
* @throws Exception For any errors.
*/
public abstract void takeAction() throws Exception;
}
114 changes: 114 additions & 0 deletions src/main/java/uk/ac/soton/itinnovation/hmncore/Artefact.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
/////////////////////////////////////////////////////////////////////////
//
// © University of Southampton IT Innovation Centre, 2017
//
// Copyright in this software belongs to University of Southampton
// IT Innovation Centre of Gamma House, Enterprise Road,
// Chilworth Science Park, Southampton, SO16 7NS, UK.
//
// This software may not be used, sold, licensed, transferred, copied
// or reproduced in whole or in part in any manner or form or in or
// on any media by any person other than in accordance with the terms
// of the Licence Agreement supplied with the software, or otherwise
// without the prior written consent of the copyright owners.
//
// This software is distributed WITHOUT ANY WARRANTY, without even the
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE, except where stated in the Licence Agreement supplied with
// the software.
//
// Created By : Vegard Engen
// Created Date : 2017-02-02
// Created for Project : HUMANE
//
/////////////////////////////////////////////////////////////////////////
package uk.ac.soton.itinnovation.hmncore;

import java.io.Serializable;
import java.util.Date;

/**
* An abstract class reflecting an Artefact in the HMN, which is a type of node that
* does not have agency. That could be a file, a forum post, a Tweet, an email, etc.
* @author Vegard Engen
*/
public class Artefact extends Node implements Serializable
{
// private String artefactID; // use nodeID
protected Agent creator;
protected Date creationDate;

/**
* Default constructor, which does nothing.
*/
public Artefact() { }

/**
* Constructor to set the node who created this artefact and the date this occurred.
* @param id The ID of the artefact.
*/
public Artefact(String id)
{
this.nodeID = id;
}

/**
* Constructor to set the node who created this artefact and the date this occurred.
* @param a Agent object for the creator of this artefact.
* @param d The date for which the artefact was created.
*/
public Artefact(Agent a, Date d)
{
this.creator = a;
this.creationDate = d;
}

/**
* Constructor to set the node who created this artefact and the date this occurred.
* @param id The ID of the artefact.
* @param a Agent object for the creator of this artefact.
* @param d The date for which the artefact was created.
*/
public Artefact(String id, Agent a, Date d)
{
this.nodeID = id;
this.creator = a;
this.creationDate = d;
}

/**
* Get the creator (agent) of this artefact.
* @return Agent object.
*/
public Agent getCreator()
{
return creator;
}

/**
* Set the creator (agent) of this artefact.
* @param creator Agent object.
*/
public void setCreator(Agent creator)
{
this.creator = creator;
}

/**
* Get the date for which this artefact was created.
* @return Date object.
*/
public Date getCreationDate()
{
return creationDate;
}

/**
* Set the date this artefact was created.
* @param creationDate Date object.
*/
public void setCreationDate(Date creationDate)
{
this.creationDate = creationDate;
}
}
Loading

0 comments on commit 8691d75

Please sign in to comment.