Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ replay_pid*
.DS_Store

# Render files
*.pdf
*tmp.html

# Folders that will not be committed to the repo, even if private
Expand Down
10 changes: 6 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Calendar Versioning](https://calver.org/) of
the following form: YYYY.0M.0D.

## 2025.09.21
## 2025.11.11

### Added

- Designed a Data Structures to HTML component
- Designed an Artificial Neuron component
- Designed a Library System component
- Designed kernel and enhanced interfaces for the Artifical Neuron component

### Updated

- Changed design to include queues representing each set of weights and inputs
Binary file not shown.
21 changes: 4 additions & 17 deletions doc/02-component-proof-of-concept/02-component-proof-of-concept.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# Portfolio Part 2: Component Proof-of-Concept

- **Name**: <!-- TODO: fill with first and last name (e.g., Brutus Buckeye) then delete this comment -->
- **Dot Number**: <!-- TODO: fill with OSU dot number (e.g., buckeye.17) then delete this comment -->
- **Due Date**: <!-- TODO: fill out with due date and time (e.g., 10/17 @ 3:10 PM EST) then delete this comment -->
- **Name**: Grace Metz
- **Dot Number**: Metz.403
- **Due Date**: 10/9/25

## Assignment Overview

<!-- TODO: read the assignment overview then delete this comment -->

Previously, you brainstormed three ideas, and hopefully you got some feedback as
well. However, it's impossible to know how reasonable your design actually is
without trying to implement it. Because you're only just learning our full
Expand All @@ -30,8 +28,6 @@ the more work you can put in now, the better.

## Assignment Checklist

<!-- TODO: browse the checklist then delete this comment -->

To be sure you have completed everything on this assignment, we have littered
this document with TODO comments. You can browse all of them in VSCode by
opening the TODOs window from the sidebar. The icon looks like a tree and will
Expand All @@ -53,8 +49,6 @@ to the tree diagram (you may remove this one as well):

## Assignment Learning Objectives

<!-- TODO: read the assignment learning objectives then delete this comment -->

Without learning objectives, there really is no clear reason why a particular
assessment or activity exists. Therefore, to be completely transparent, here is
what we're hoping you will learn through this particular aspect of the portfolio
Expand All @@ -68,8 +62,6 @@ project. Specifically, students should be able to:

## Assignment Rubric: 10 Points

<!-- TODO: read the assignment rubric then delete this comment -->

Again, to be completely transparent, most of the portfolio project, except the
final submission, is designed as a formative assessment. Formative assessments
are meant to provide ongoing feedback in the learning process. Therefore,
Expand Down Expand Up @@ -114,8 +106,7 @@ Below is further rationale/explanation for the rubric items above:
> to create a new design. In you do end up picking one at random, you should
> disclose that here as well.

<!-- TODO: briefly argue your choice of design or design something
new; then delete this comment -->
I believe that the artificial neuron is the one that is the most interesting to me personally, and I also believe that, minus some need for research on machine learning algorithms, the component would likely be fairly simple to implement. At the most basic level, it essentially functions as a calculator; evaluating values based on a pre-set formula and outputting a result.

> Once you've argued your choice of design, make a branch in your new repo called
> something like `proof-of-concept`. There are many ways to do this, but my
Expand All @@ -126,8 +117,6 @@ new; then delete this comment -->
> we'll want a branch that you can later make a pull request from with all
> your changes.

<!-- TODO: make a new branch from main then delete this comment -->

## Assignment Tasks

As stated previously, your goal with this assignment is to produce a Java
Expand All @@ -153,8 +142,6 @@ completed the assignment.

### Changelog

<!-- TODO: update CHANGELOG then delete this comment -->

At the end of every assignment, you should update the
[CHANGELOG.md](../../CHANGELOG.md) file found in the root of the project folder.
Here's what I would expect to see at the minimum:
Expand Down
10 changes: 4 additions & 6 deletions doc/03-component-interfaces/03-component-interfaces.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Portfolio Part 3: Component Interfaces

- **Name**: <!-- TODO: fill with first and last name (e.g., Brutus Buckeye) and delete this comment -->
- **Dot Number**: <!-- TODO: fill with OSU dot number (e.g., buckeye.17) and delete this comment -->
- **Due Date**: <!-- TODO: fill out with due date and time (e.g., 10/17 @ 3:10 PM EST) and delete this comment -->
- **Name**: Grace Metz
- **Dot Number**: metz.403
- **Due Date**: 10/23 12:40pm

## Assignment Overview

Expand Down Expand Up @@ -132,7 +132,7 @@ hierarchy diagram using whatever tools you would like. Then, include a picture
of it in this folder. You may also embed it just below using markdown syntax
(i.e., `![ALT TEXT](path/to/file)`).

<!-- TODO: make a diagram of your component hierarchy then delete this comment -->
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe PDFs can be embedded in markdown, but I was able to view the file.

![Interfaces Diagram](doc\03-component-interfaces\Interfaces (1).pdf)

To start making your interfaces, make a branch off of main in your new repo
called something like `interfaces`. There are many ways to do this, but my
Expand All @@ -154,8 +154,6 @@ to see them. If you don't like this workflow, you may try following the
rebase strategies described [here](https://stackoverflow.com/questions/35790561/working-while-waiting-for-pending-pr)
and [here](https://stackoverflow.com/questions/18021888/continue-working-on-a-git-branch-after-making-a-pull-request).

<!-- TODO: make a new branch from main then delete this comment -->

## Assignment Tasks

Your primary task for this assignment is to draft two interfaces in line with
Expand Down
Binary file not shown.
Binary file added doc/03-component-interfaces/Interfaces.pdf
Binary file not shown.
Binary file not shown.
7 changes: 7 additions & 0 deletions lib/components (3).jar_unzipped/META-INF/MANIFEST.MF
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what's going on in the lib folder. You should be able to drop the JAR in there as-is. Seems like you might have unzipped it.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.10.12
Created-By: 19.0.1+10-21 (Oracle Corporation)
Built-By: Paolo Bucci
Sealed: false
Built-On: 2023-01-01 10:30:08

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions src/Neuron.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

/**
* Interface for additional methods within the Artificial Neuron component.
*
* @author Grace Metz
*
*/
public interface Neuron extends NeuronKernel {

/**
* Using the sigmoid activation function: an output >= 0.5 means a yes, or
* the neuron has fired.
*
* @requires {@code |this.weights| >= 0 && |this.inputs| >= 0}
* @ensures {@code <activate> = true || false}
* @return whether the neuron has fired.
*/
boolean activate();

/**
* Set an object's weight and ensure that it is usable by the neuron.
*
* @param value
* the weight being entered
* @requires {@code -1 <= value <= 1}
* @ensures {@code this.weights = #this.weights * #value}
*/
void setWeight(double value);

/**
* Sum the weights.
*
* @requires {@code |this.weights| >= 0}
* @ensures {@code sum = this.weights[0] + ... + this.weights[|this.weights|]}
* @return the sum of the weights.
*/
double sum();

}
70 changes: 70 additions & 0 deletions src/Neuron1.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import components.queue.Queue;
import components.queue.Queue1L;

/**
* {@code Neuron} represented as multiple {@link Queue}s with implementations of
* primary methods.
*
* @convention [$this.inputs is a queue of String inputs] and [$this.weights is
* a queue of double weights]
* @correspondence this = ($this.inputs, $this.weights)
*/
public class Neuron1 extends NeuronSecondary {

/**
* Queue of Strings to represent the values of each input.
*/
private Queue<String> inputs = new Queue1L<>();

/**
* Queue of values to represent the weights of each input.
*/
private Queue<Double> weights = new Queue1L<>();

/**
* Creator of initial representation.
*/
private void createNewRep() {
this.inputs = new Queue1L<>();
this.weights = new Queue1L<>();
}

/**
* No-argument constructor.
*/
public Neuron1() {
this.createNewRep();
}

@Override
public final Queue<Double> weights() {
return this.weights;
}

@Override
public final Queue<String> inputs() {
return this.inputs;
}

@Override
public final void setInput(String value) {
this.inputs.enqueue(value);
}

@Override
public final void clear() {
this.inputs = this.inputs.newInstance();
this.weights = this.weights.newInstance();
}

@Override
public final Neuron newInstance() {
Neuron newIn = new Neuron1();
return newIn;
}

@Override
public final void transferFrom(Neuron arg0) {
// TODO finish this for part 6
}
}
41 changes: 41 additions & 0 deletions src/NeuronKernel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import components.queue.Queue;
import components.standard.Standard;

/**
* Interface for the essential methods and values within the Artificial Neuron
* component.
*
* @author Grace Metz
*
*/
public interface NeuronKernel extends Standard<Neuron> {

/**
* Retrieve the weight assigned to the inputs within this node.
*
* @requires {@code |weights| >= 0}
* @ensures {@code <weights> = weights}
* @return the queue of weight values
*/
Queue<Double> weights();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs look good


/**
* Return the inputs entered into the neuron.
*
* @requires {@code |inputs| >= 0}
* @ensures {@code <inputs> = inputs}
* @return the queue of input Strings
*/
Queue<String> inputs();

/**
* Ensure that inputs are valid and usable by the neuron.
*
* @param value
* the String value being entered
* @requires {@code <value> != null}
* @ensures {@code <inputs> = #inputs * #value}
*/
void setInput(String value);

}
105 changes: 105 additions & 0 deletions src/NeuronSecondary.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
import components.queue.Queue;

/**
* Interface for additional methods within the Artificial Neuron component.
*
* @author Grace Metz
*
*/
public abstract class NeuronSecondary implements Neuron {

/**
* Queue of Strings to represent the values of each input.
*/
private Queue<String> inputs;

/**
* Queue of values to represent the weights of each input.
*/
private Queue<Double> weights;

/**
* Using the sigmoid activation function: an output >= 0.5 means a yes, or
* the neuron has fired.
*
* @requires {@code |this.weights| >= 0 && |this.inputs| >= 0}
* @ensures {@code <activate> = true || false}
* @return whether the neuron has fired.
*/
@Override
public boolean activate() {
double s = 1.0 / (1.0 + Math.exp(this.sum()));
boolean fired = false;

if (s >= 0.5) {
fired = true;
}

return fired;
}

/**
* Set an object's weight and ensure they are usable by the neuron.
*
* @param value
* the weight being entered
* @requires {@code -1 <= value <= 1}
* @ensures {@code this.weights = #this.weights * #value}
*/
@Override
public void setWeight(double value) {
this.weights.enqueue(value);
}

/**
* Sum the weights.
*
* @return the sum of the weights.
*/
@Override
public double sum() {
double sum = 0;
double weight = 0;
if (this.weights.length() > 0) {
weight = this.weights.dequeue();
sum = this.sum() + weight;
}
this.weights.enqueue(weight);

return sum;
}

/**
* Return the data in the Neuron component as a string.
*
* @return the String representing the Neuron.
*/
@Override
public String toString() {
StringBuilder result = new StringBuilder();
result.append("Neuron [weights=");
result.append(this.weights.toString());
result.append("]");
result.append("[inputs=");
result.append(this.inputs.toString());
result.append("]");
return result.toString();
}

/**
* Return whether or not this equals an object.
*
* @return whether this equals an object.
*/
@Override
public boolean equals(Object o) {
Neuron object = this.newInstance();

if (!(o == null || this.getClass() != o.getClass())) {
object = (Neuron) o;
}

return this.weights.equals(object.weights())
&& this.inputs.equals(object.inputs());
}
}
Loading