设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12456|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 L% a3 c$ G) j" P
! e  \; F. G- F6 O我的问题是,在每个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中的数值,不知道会不会有什么不妥。: ?6 E) q: e4 H

% }8 x" m! D+ r  _+ Q* h2 A0 B# rbegin P_read arriving1 ?' G. I0 y  p0 A# Z% v3 ?! ]
    while 1=1 do begin
$ z6 P  J* I" g2 U0 ?4 }        read A_tote from "data.txt" with delimiter "\n"
5 i7 n; R$ I+ k$ b( x' G, {6 |        read A_time from "data.txt" with delimiter "\n"2 w9 m5 B# a% h  E9 J! p( @1 z2 x( ?
        read A_leave from "data.txt" with delimiter "\n"/ Q2 M$ d5 h* m# C7 X+ d
        read A_picks from "data.txt" with delimiter "\n"
& j% \4 t: O5 a        set load type to A_tote3 b  R; ~: @1 n& j! Q, B% p4 v- G8 K
        if A_tote="tote 1" then set A_induct to 15 j' J. w, {" n) i6 E
        else if A_tote="tote 2" then set A_induct to 2
5 }3 `0 `& j, a5 x: q/ u            else set A_induct to 3   
$ n/ y0 H0 }  c7 V        set A_i to 0
: `! {0 P0 T5 }, d        clone 1 load to P_induction- Y1 u8 {2 K7 e' G( W/ i( C
        wait for A_time sec
  c7 `6 ^0 z. [* I# m& X  l7 q    end: E" V* V) y1 v- F2 S
end/ D. M# p) v6 \% V- D
, w6 `) l& z, Z1 q! K7 C
begin P_induction arriving
/ e  l+ f: J4 \2 O0 O4 B    if A_induct=1 then clone 1 load to P_pick1
7 z9 T7 X- P) L' G) Q: Q' K    else if A_induct=2 then clone 1 load to P_pick2# u" G. x; b  Z+ k! a; q
        else clone 1 load to P_pick38 y0 v2 A8 \6 u7 _" r, u
end
; _- P, h$ _; P& \, _; c# [5 [2 F6 \, A$ @* k- V- v, f" u' d7 k0 z
begin P_pick1 arriving7 [1 m" i! [; T% m) W, ]
    set A_i to 1
9 ~" i9 ^+ o3 V1 K( F) U# e: u    move into Q_induct1
7 B; f5 f3 q( X, ^% s# O    move into pickaisle.induct1
; `5 |0 P! r1 W7 K/ t, e    while A_i<=30 do begin
, }1 `+ q; S+ F1 e        travel to pickaisle.con(A_i)
: B, D3 ~8 H8 N, l: J3 N, {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 o: s; b2 S" _. @. `  f
        else wait for 10 sec
" j2 L. i  ?" K1 q4 |$ r! Z0 k        if A_i=A_leave then send to die. s6 T% y6 A7 h  D
        else inc A_i by 1) k' {$ c0 G5 Q: x2 k! ?/ H; r' H
    end
3 C4 s7 E2 A2 V+ G% cend$ m* n6 Q# y/ G, i

# `& _% H! s8 ?$ Rbegin P_pick2 arriving% F% \3 Y4 B' k1 [& }3 p
    set A_i to 11
$ ?1 s1 ]# S1 E3 T6 o    move into Q_induct21 z. T  n2 l* K; [0 {
    move into pickaisle.induct28 ]! h- N! N% f) P5 z0 X$ g9 z' E/ i
    while A_i<=30 do begin' i% d4 p$ F. ^6 K& G- `
        travel to pickaisle.con(A_i)
4 v0 G8 s: N2 s. S. J% W( b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- v  h/ E0 R( y2 S1 `        else wait for 10 sec
. {+ i4 B( k1 g- n. J' ]' W/ {5 A        if A_i=A_leave then send to die; n' \: F, _/ `( r! N
        else inc A_i by 14 |4 y0 |# H; ~
    end8 X& u4 T( D; B9 u- P" a
end3 q' U, w6 w% e& l# v) {8 O/ p: P: Z

. X+ \5 `" N0 g8 }( A9 Y- Lbegin P_pick3 arriving
9 a0 S3 d2 p* P    set A_i to 21
3 [% e& G/ C& w9 W    move into Q_induct3! g2 Z! v1 Z& q' d5 s
    move into pickaisle.induct3
: p5 h7 J8 m& Q3 _6 j* K6 l    while A_i<=30 do begin
& q& `) i7 L6 p2 |4 a9 x        travel to pickaisle.con(A_i)
1 L* e: O% V0 N& q1 K1 @* ~% e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ K* t; w# j' }& R: A        else wait for 10 sec* [  d; m: c: e3 Z9 h
        if A_i=A_leave then send to die' E$ X, c2 @6 r  A2 |8 S- O  I
        else inc A_i by 1
3 Q6 O" n% w/ E$ ]9 D, J1 c    end5 c) W: j2 z9 W" H
end

最佳答案

查看完整内容

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是个什么东东?
% U! _8 ]; {9 N6 e8 G# d5 E+ [move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
. H+ g4 t, f4 _7 F0 ^
! G2 e" U3 f, h: ^( _# C/ ]7 IAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。: N/ o7 j- `: D3 _3 X1 k, x# i4 N
6 c8 i1 X+ A$ m8 z: L5 `: z' L
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
9 D( D% n1 @! v- }5 q+ F0 F% z1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
4 ]8 w( y- k: T2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
) B2 B# h9 |& t. L6 w& u3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
* N- J- I, r& n# Dbegin P_induction arriving
8 e* Y+ @. c9 C- D    clone 1 load to P_pick(A_induct)' ]+ K4 [- |4 y9 F' V. k: X
end最大的系+ a' D6 o( |" h$ A! V! j- Z
2 W0 T4 O& _0 h4 q
begin P_pick arriving
# V  \5 Q8 A8 F9 g- Q( G2 Y    set A_i to procindex * 10 + 1' i4 u/ T( q6 u/ X7 S
    move into Q_induct(procindex)- b0 C' u0 {9 Y; E
    move into pickaisle.induct(procindex)
- }* P  k" J' L8 Q5 i+ i0 Y9 `    /*check the type of pickaisle.induct(i), for your last problem.*/
+ t" L! h9 D/ B
4 S' o, Y& {$ c! N' C2 G    while A_i<=30 do begin; _6 r  |6 W0 b3 i, Y
        travel to pickaisle.con(A_i): g) @& M3 A' r; J* t
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  U4 U3 v# ?& \/ u        else wait for 10 sec
! ^- M) C9 X. T* \8 E; e/ e% \6 ~        if A_i=A_leave then send to die
8 W8 g) q$ N) h. z6 B        else inc A_i by 1
9 x# O0 V1 ?5 [  y6 J    end
/ x5 p6 @2 ?' B' {4 iend7 _8 b0 p  q8 ^' F1 l6 D/ W
) a, @: j& v! b# |# o/ ^4 L# P
其中的procindex为整形,代表当前process的序号。
0 B$ O, I5 a( j2 \: Z/ {$ Zstation和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-1-25 13:50 , Processed in 0.019276 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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