25
BENG 108 Final Project Corydoras Species Identifier Program Jason Trimble & Max Peterson

BENG 108 Final Project

Embed Size (px)

Citation preview

Page 1: BENG 108 Final Project

BENG 108 Final ProjectCorydoras Species Identifier

ProgramJason Trimble & Max Peterson

Page 2: BENG 108 Final Project

Core Principles and Goals Create a program that can identify individual species of the

genus Corydoras given a set of observed physical traits inputted by the user

Make this program easy to use

Create a second program for admins to add new species into the database

Optimize both for use online at www.planetcatfish.com

Page 3: BENG 108 Final Project

Key Preliminary Problems Downloading individual photos of each species

Deciding what physical characteristics would be most beneficial for species identification

Defining the characteristics that each individual species possesses

Ensuring each characteristic set has enough variation to narrow species possibilities for a set of observations down to at most 5

Building a Labview accessible database of all the above information

Page 4: BENG 108 Final Project

Solutions Use of inspect tool circumventing copyright law

Collaborating with the other groups to create a standard for physical characteristics such as nose type, dorsal fin pattern and overall body pattern

Using a google docs excel file to utilize all group members in building a database

Integrating this excel file into our Labview program

Page 5: BENG 108 Final Project

Our Program - DatabaseSpecies Name Pattern Number Mask Number Saddle Number Nose Blanket Dorsal Fin Pattern Tail Fin Pattern

Acutus 1 0 0 3 0 2 1

Agassizii 1 0 0 1 0 0 1Albolineatus 1 0 0 0 0 4 1 Legend: Mask Number

Ambiacus 1 0 1 2 0 3 1 0 - No Mask

Araguaiaensis 1 0 0 0 0 0 1 1 - Mask

Areio 1 1 0 2 0 4 0

Armatus 1 0 0 0 0 1 0 Legend: pattern number

Atropersonatus 1 1 0 2 0 4 0 0 - stripes

Bicolor 1 1 1 2 0 3 0 1 - spots

Blochi 1 1 1 3 0 1 1 2 - reticulated

Brevirotris 1 1 1 2 0 1 1 3 - no pattern (non metallic)

Carlae 1 0 1 2 0 0 1 4 - metallic

Caudimaculatus 1 0 0 2 0 0 1 5 - large spot

Cervinus 1 0 0 3 0 0 0 6 - large stripe

Cf_cochui 1 0 0 0 0 1 1 7 - gold/orange

Cf_julii 1 0 0 2 0 2 1

Cf_sanchesi 1 0 0 0 0 0 1

Cochui 1 0 0 0 0 0 1

Axelrodi 0 1 0 2 0 3 2

Page 6: BENG 108 Final Project

Materials

Labview Property and Invoke Nodes Local variables Selector functions Case structures Frame structure String indicators/ LEDs/ next function Number to decimal string function Initialize/ index/ build array function Array max and min function

Page 7: BENG 108 Final Project

Materials (cont.)

Excel Google Docs Planet Catfish

Page 8: BENG 108 Final Project

Our Program – User Interface

As mentioned in the program requirements, there needs to be options for both finding a fish species from traits and adding a new fish species to the data file.

This was done by using string indicators for displaying these two options and having the user select an LED.

If the user selects the add new species option, then a name for the species must be typed in a string control.

The user must confirm his/ her choice by clicking a next button. The trait options are displayed in a similar fashion with string

indicators for displaying the trait and its options. The user must click a corresponding LED.

Another next button is used to cycle between traits.

Page 9: BENG 108 Final Project

Our Program – User Interface (cont.)

There are 8 indicators and LEDS for up to 8 trait options, but the higher numbers are generally not needed and hidden from the user for traits with only a few options.

The LED buttons and next buttons must be reinitialized in order for them to remain unlit after switching traits (prevents user confusion and decreases the chances of selecting multiple options.

For the finding a fish option, the matching fish species (one or a few) with the corresponding trait options are displayed by their name.

There is a reminder to check the database text file if the add fish species option was selected.

A welcome message is displayed to the user when starting the program.

Page 10: BENG 108 Final Project

Our Program – User Interface

Page 11: BENG 108 Final Project

Our Program – Inner Workings

A 1D array is created for storing the trait choices that the user makes. A frame structure is used to sequence the events in the program. For each LED button, there is a selector function which passes

forward the option number (array style 0, 1, …) if the LED was pressed (true). If the LED was not pressed (false), then a -1 is passed forward.

The selector function answers are combined together and then the maximum value is chosen since the negative values are false (build array + max/min). If more than one button is pressed, then the later option is chosen.

A case structure is used to initialize the add a new species option if that was chosen. A true constant is passes forward for adding to the end of the database file. The new fish species name is also passed forward.

Page 12: BENG 108 Final Project

Our Program – Inner Workings (cont.) Each section of the program is encased in a while loop which

prevents the user from moving forward if the next button is not clicked.

The LEDs, string indicators, and next buttons are reinitialized between frames of the code (using invoke nodes).

The string indicators and controls are chosen to be visible or invisible for each section of code (using property nodes).

The trait option value must be greater than or equal to 0 (meaning true) in order for the number choice to be passed forward (true condition).

For each additional trait, the array of choices is passed forward, a new choice number is added to the array, local variables are used to reuse the same LED, string indicator, or next button, and visibility of trait options varies.

Page 13: BENG 108 Final Project

Our Program – Inner Workings (cont.)

Page 14: BENG 108 Final Project

Our Program – Inner Workings (cont.)

Page 15: BENG 108 Final Project

Our Program – Inner Workings (Finding Matching Species) The choice array is converted into strings since this is easier to compare (use

number to decimal string function). The database file is read in and converted into an array (read from text file and

spreadsheet string to array functions). Beginning with the first choice and the second column of the database file (skips

fish species names), a for loop cycles through the second column of the data file in order to find the first choice by seeing whether or not the values are equal. If the values are equal, the entire row of the file is added to and array. The initialize, index, and build array functions are used.

The new array and the array of choices are passes forward to the next comparison segment of the code, where a new array is made by comparing the next values (such as 2nd choice and 3rd column). This new array is a subset of the previous new array.

All of the choices are compared until only one or a few matches remain.

Page 16: BENG 108 Final Project

Our Program – Inner Workings (Finding Matching Species)

Page 17: BENG 108 Final Project

Our Program – Inner Workings (Adding a New Fish Species) A case structure at the end of the code only executes the true

condition if the user chose earlier that he/ she wants to add a new fish species to the end of the database file.

The array of choices and the new species name are passed forward with the name being inserted in front of the values in the 1D array (use insert into array function).

The 1D array for the new fish species with its name and associated trait numbers is passed into the original database text file as the last row (use write to delimited spreadsheet function).

Page 18: BENG 108 Final Project

Our Program – Inner Workings (Adding a New Fish Species)

Page 19: BENG 108 Final Project

Errors and Bug Fixes

Errors Program kept skipping over first trait. LEDs stayed lit through the entire program. Putting the frame structure within a case structure (hard to copy). Can’t reuse LEDs by copying.

Fixes A local variable was needed to turn off the next button from previous runs. Reinitialized LEDs after use. Putting frames at the beginning and end for adding a fish worked better. Used local variable for reusing LEDs.

Page 20: BENG 108 Final Project

Errors and Bug Fixes

Page 21: BENG 108 Final Project

Errors and Bug Fixes (cont.)

Errors Array of choices was all one number. Comparing numbers and text. Found species were repeated many times. Text file became new entries and skipped lines only.

Fixes Got rid of shift registers when building. Converted the choice value array into strings. Did not also write in original text file when adding a new species. Changed wiring.

Page 22: BENG 108 Final Project

Errors and Bug Fixes (cont.)

Page 23: BENG 108 Final Project

Demonstration

Page 24: BENG 108 Final Project

Conclusion

Both being able to find a species based on traits and adding a new species of catfish to the end of the database file were functional.

Page 25: BENG 108 Final Project

If it was Perfect… The program would constantly calculate possible species even if only one

characteristic is chosen. Picture attachments as well as a link to the species web page would appear with

the species name in the program .

A perfect database where multiple species do not fit the same set of characteristics .

The user would not be able to select multiple options or select nothing (could be more error handling and user-friendly).

Reentry of new species name would not count.