设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13945|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
/ {5 s6 k/ w5 e7 J5 `
/ v) _* Z5 j3 J. p, D6 v  k我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。2 i6 @  G; o5 y8 [- b; t. T" b
) u* t7 b6 u0 r( g4 ]9 N
begin P_read arriving
7 ?/ e1 h; b6 B) P    while 1=1 do begin% ]  f# |1 v9 A" G: ?# u
        read A_tote from "data.txt" with delimiter "\n"6 |  Z# }4 v7 W6 Q
        read A_time from "data.txt" with delimiter "\n"# L! ^6 n9 L, C0 ~9 f
        read A_leave from "data.txt" with delimiter "\n"  `$ |; ]$ b7 j7 S8 ~
        read A_picks from "data.txt" with delimiter "\n"4 k& d$ `  m- B% n6 {# J  r
        set load type to A_tote, p; s1 T9 i3 X/ e9 Q2 e
        if A_tote="tote 1" then set A_induct to 13 h% R7 R+ l$ v
        else if A_tote="tote 2" then set A_induct to 2' {6 _$ I) h2 R% x
            else set A_induct to 3   
+ n* M* `' b% n% i& D& I+ B1 }* d0 T( m        set A_i to 0
, w, Y7 h; k% ?/ e" y/ w* M        clone 1 load to P_induction6 N' |+ Z" e5 U4 z, ^
        wait for A_time sec
+ \- V5 {3 ]% g1 n. y# O  X8 V7 `    end
% t5 _& Z1 w- o7 Wend; g1 O* I& z$ Y3 E9 p* M

1 J. k% X( O# ?5 @: tbegin P_induction arriving7 j( r5 \( c7 Q/ `' L, T2 C
    if A_induct=1 then clone 1 load to P_pick11 c9 q+ j! o8 _& t3 j
    else if A_induct=2 then clone 1 load to P_pick2
4 f# ~1 \$ X. O/ K+ v2 ^7 _" E        else clone 1 load to P_pick38 T6 Q2 C" U1 w" e& ?
end
9 G" h2 u) i. e
; b) n! I0 [1 R# {  s; ]begin P_pick1 arriving
; x' G4 n1 t; v, {* P    set A_i to 1
; n& C: j  C9 y' P    move into Q_induct1
/ m8 d6 |9 s6 ^$ v    move into pickaisle.induct1
* R2 n6 |" G% q( z9 e4 I    while A_i<=30 do begin
+ h9 n5 q4 r0 J        travel to pickaisle.con(A_i)
' @4 P1 _1 G  ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 |1 i/ w8 h1 b7 k" U: T5 C+ ?
        else wait for 10 sec+ _# I4 L' w3 C. p  ~& M- N' J
        if A_i=A_leave then send to die3 h; J8 i7 x* D7 R! H8 C, h
        else inc A_i by 1+ K: C+ [6 h& P1 ?: {
    end% Z' `8 ^* W. G% L' e  K& k
end
& U5 Y3 h" p* {) D/ `- m) @/ L3 Q# O8 u: j
begin P_pick2 arriving
6 f9 p; a7 I4 B* _. }) |, J0 P    set A_i to 11
( g( ]$ O! r6 y; M) m    move into Q_induct2: M" b# b5 C' B5 u' l: X
    move into pickaisle.induct2: r4 r- `6 Q* D* d
    while A_i<=30 do begin( m" i& m# x$ O
        travel to pickaisle.con(A_i)
+ |% Y5 Z: Q. v1 z/ M1 H1 q/ @        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ M/ _$ E: E3 z# c1 b
        else wait for 10 sec. ~7 E2 r7 Y, r
        if A_i=A_leave then send to die
0 I# F# b3 M4 y' n9 W  k9 g        else inc A_i by 17 i, |% @3 A8 U  P* ~
    end% R/ |8 ^$ A4 V. c( i( s* h
end
; F, f3 y2 j3 U2 q, p+ x+ P' a4 ^5 _
begin P_pick3 arriving
3 q" y, }6 Z1 T( i7 j    set A_i to 21
! R+ Z+ `* B4 |    move into Q_induct38 I$ K7 ?! o! z
    move into pickaisle.induct3
* K7 F" `; O6 z- ?) W    while A_i<=30 do begin  A; K5 Q$ f1 S' V/ X
        travel to pickaisle.con(A_i)5 J0 C; l) X. _8 H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" p5 d; R" {+ Z* Q( T        else wait for 10 sec
6 _5 H8 u2 H6 U9 U% Y& P        if A_i=A_leave then send to die( [/ J& c" R4 V7 ?0 L, ~: `
        else inc A_i by 17 N0 `+ m' J- ^- N& R" t
    end
+ k" e: r3 N, e8 b) M* Uend

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?
$ r, g% V. q- y$ Zmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
6 I- _6 K5 [8 R: M, v' {
) _: Y4 v; b9 F. i( g% P) z! R. zAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
* c$ [# ~) z7 h3 d# D* L8 w2 q  ^  C6 X1 h
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
; U' p2 K$ ?) a) R" @1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
+ G  I/ I1 B" V1 ~) J2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
5 h0 B0 V! l7 p3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
* e1 n2 I8 O2 S4 ?8 Qbegin P_induction arriving0 n/ }8 ?3 N% [4 S6 }8 M
    clone 1 load to P_pick(A_induct); D: x3 Z2 r! k  f
end最大的系
) A% r+ o1 n" c% ]
7 _: L1 [" a+ w0 @) pbegin P_pick arriving
7 a- u- [1 |. {( c, Z% r( ~* v    set A_i to procindex * 10 + 1, Y2 s! H0 `+ Z) Y
    move into Q_induct(procindex)2 m' z  ^5 {/ D$ ?" q
    move into pickaisle.induct(procindex)! ~5 h+ S0 r' u6 v) Y& B
    /*check the type of pickaisle.induct(i), for your last problem.*/! q! @6 I9 u% Z% {3 d& p
7 {* S6 C4 \4 d* z, M- l* g
    while A_i<=30 do begin
1 }0 v0 c( k# U  \/ D: ?2 ^3 K        travel to pickaisle.con(A_i)
- q/ o1 O' ^6 m2 r* V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" M! u# U* \! H4 u. ~. s6 r        else wait for 10 sec
4 u3 H( @8 p/ o! N4 g        if A_i=A_leave then send to die( B( W$ g# T$ u' I/ ]( t* h/ E
        else inc A_i by 1
0 A, J# v' l# N; R# F    end
( k8 y/ S& `* y7 j" b5 m! tend
: M" B4 D& O1 t7 F5 o4 W) `: m4 [7 i" q4 _9 C$ ^9 R
其中的procindex为整形,代表当前process的序号。
; Y, y) n  S: M) I& q5 Estation和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-5-22 10:26 , Processed in 0.018668 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表