Skip to content
This repository has been archived by the owner on May 28, 2021. It is now read-only.

Commit

Permalink
got stuff polished
Browse files Browse the repository at this point in the history
  • Loading branch information
fulton committed Feb 15, 2020
1 parent 1680854 commit 4105d5f
Show file tree
Hide file tree
Showing 27 changed files with 56 additions and 198 deletions.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
67 changes: 41 additions & 26 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified build/kotlin/compileKotlin/build-history.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab
Binary file not shown.
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/last-build.bin
Binary file not shown.
Binary file modified build/libs/mars-1.2.1.jar
Binary file not shown.
12 changes: 0 additions & 12 deletions src/main/java/com/andromeda/mars/brain/Brain.kt

This file was deleted.

4 changes: 0 additions & 4 deletions src/main/java/com/andromeda/mars/brain/BrainType.kt

This file was deleted.

19 changes: 0 additions & 19 deletions src/main/java/com/andromeda/mars/brain/CLI.kt

This file was deleted.

6 changes: 0 additions & 6 deletions src/main/java/com/andromeda/mars/brain/Cell.kt

This file was deleted.

80 changes: 5 additions & 75 deletions src/main/java/com/andromeda/mars/brain/CellBase.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,64 +2,15 @@

package com.andromeda.mars.brain

import com.andromeda.mars.models.StructuredData
import kotlin.math.absoluteValue

open class CellBase(u: Int) {
open class CellBase {
var isRunning = true
private val unitSize = u
private var finalData = 0
private val dataForMatch = arrayListOf<Int>()
val structuredData = arrayListOf<StructuredData>()
var useDefaultOperation = true
var dataScript = ""
val cells = arrayListOf<CellBase>()


private val data = arrayListOf<Int>()
val cells = arrayListOf<CellBase>()

open fun dataToCell(newData:Int){
if(isRunning)data.add(newData)
else return
if (data.size == unitSize){
isRunning = false
println(cells.size)
val newData2 = data

for (it in newData2) {
finalData = if (finalData == 0) it
else finalData.xor(it)
dataOutOfCell(finalData)

}
data.clear()
isRunning = true
}

}
open fun dataToCell(newData:Int, label:Int){
if(isRunning)dataForMatch.add(newData)
else return
if (dataForMatch.size == unitSize){
isRunning = false
for (i in structuredData) {
if (i.label == label){
i.addData(dataForMatch, this)
dataForMatch.clear()
isRunning = true
return
}
}
structuredData.add(StructuredData(label, dataForMatch))
dataForMatch.clear()
isRunning = true



}


}
open fun dataToCell(newData:ArrayList<Int>, label:Int){
isRunning = false
for (i in structuredData) {
Expand All @@ -71,30 +22,19 @@ open class CellBase(u: Int) {

}
structuredData.add(StructuredData(label, newData))
dataForMatch.clear()
isRunning = true



}
open fun dataToCell(newData:ArrayList<Int>, label:String){
if(isRunning)dataForMatch.addAll(newData)
else return
if (dataForMatch.size == unitSize){
isRunning = false
for (i in structuredData) {
if (i.label == label){
i.addData(dataForMatch, this)
dataForMatch.clear()
i.addData(newData, this)
isRunning = true
return
}

}
structuredData.add(StructuredData(label, dataForMatch))
structuredData.add(StructuredData(label, dataForMatch))
dataForMatch.clear()
isRunning = true
structuredData.add(StructuredData(label, newData))



Expand Down Expand Up @@ -126,17 +66,7 @@ open class CellBase(u: Int) {
}
return lowest
}
open fun dataOutOfCell(toSend:Int){
println(toSend)
try {
cells.forEach {
it.dataToCell(toSend)
}
}
catch (e:Exception){
e.printStackTrace()
}
}

fun operation(newData: Int, oldData:Int): Int {
if (!useDefaultOperation){
return scriptedOperation()
Expand Down
32 changes: 0 additions & 32 deletions src/main/java/com/andromeda/mars/brain/Generate.kt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package com.andromeda.mars.models

import com.andromeda.mars.brain.CellBase
package com.andromeda.mars.brain

class StructuredData(val label:Any, val data:ArrayList<Int> ) {
fun addData(newData:ArrayList<Int>, cellBase: CellBase){
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.andromeda.mars.readers
package com.andromeda.mars.demos.readers

import java.io.InputStreamReader
class GetReader {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.andromeda.mars.readers
package com.andromeda.mars.demos.readers

import com.univocity.parsers.tsv.TsvParser
import com.univocity.parsers.tsv.TsvParserSettings
Expand Down
Loading

0 comments on commit 4105d5f

Please sign in to comment.