设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15330|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
8 g/ e7 w' q: p
1 q& E) W- t- _9 I我的问题是,在每个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中的数值,不知道会不会有什么不妥。& x& |$ w# c/ @0 g$ A! L8 z

' h9 s/ S: U) F' `6 f) {; ubegin P_read arriving! N* k# I6 ?! N3 S. W
    while 1=1 do begin. I  ?  k' L6 L* B
        read A_tote from "data.txt" with delimiter "\n"
# A, v$ [3 r, ^! m  c7 j        read A_time from "data.txt" with delimiter "\n": K/ B' }8 o' V+ e/ J4 K: F
        read A_leave from "data.txt" with delimiter "\n"
0 j' d% j. S9 l3 ^% ?0 o6 ~  _        read A_picks from "data.txt" with delimiter "\n"
1 r! T2 {4 }7 F* u# D* P        set load type to A_tote
$ I3 r3 |8 z/ u3 A! C. E        if A_tote="tote 1" then set A_induct to 1
, ~' e9 W9 _9 U        else if A_tote="tote 2" then set A_induct to 2" B0 o/ Z3 |. f: [# X6 a; y
            else set A_induct to 3   
6 Z) D1 P! A5 b* z        set A_i to 09 U5 y& x/ [% D0 e
        clone 1 load to P_induction: d8 S4 j+ i6 M4 w1 F, p3 j8 g. I
        wait for A_time sec/ F$ o% {$ S3 [+ v6 G/ m  w+ J
    end( L$ o1 O0 b' ]6 j2 z/ M% ~' z
end
" l0 x6 l5 T" ]' o  _' G
, K2 `$ Q% ?6 fbegin P_induction arriving4 a( M) b* c0 |
    if A_induct=1 then clone 1 load to P_pick1: m7 W' X% e0 X7 F" Q2 }, N
    else if A_induct=2 then clone 1 load to P_pick2* ]3 p& z% `, F; ~
        else clone 1 load to P_pick3
6 }) H" h6 Q0 f1 V+ G# ^end
) i3 G9 m2 j& {' c& `* I
0 @* f; ~! M! f. L- O, \2 z8 abegin P_pick1 arriving2 Y- z/ [7 z6 i
    set A_i to 1
  A# R: U5 b, d9 h    move into Q_induct1& l& c0 E, J0 P+ U4 }* B+ ?7 K3 k
    move into pickaisle.induct1
; d. j1 Y- f' S3 c0 a; u    while A_i<=30 do begin
7 S0 \; {3 M$ }* f; C        travel to pickaisle.con(A_i)7 H( s7 A$ P/ @- f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 P! g" h# H7 l( v1 W& ~0 B        else wait for 10 sec
3 T4 g. r' {* O% D, N) R- Q- X3 a* A5 p        if A_i=A_leave then send to die( W( N; l: W1 Z
        else inc A_i by 1
7 l8 K# U& n$ c8 C    end
  f: {- M# ~, y& q0 |8 [1 h& L- aend
  S$ N" s( V; c1 d! W; U* n- v& c0 k, O1 \# @
begin P_pick2 arriving
3 R% @. V' r1 J' n    set A_i to 11
8 B1 q5 k$ n" ?4 J    move into Q_induct2
$ H6 [) w- P7 D+ |  r/ r  V    move into pickaisle.induct2
9 J: o) r% Y, b: U( w: s    while A_i<=30 do begin
& s  N5 b$ p- x' S" U        travel to pickaisle.con(A_i)7 X% P( [3 q- _1 W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 N. m" j# j! o$ O+ k$ W. k& @
        else wait for 10 sec. a( a; B3 M' |, L0 S1 m
        if A_i=A_leave then send to die9 p  {8 a2 n1 J" r
        else inc A_i by 1- F8 R6 ?' Q/ x7 o/ W: ~
    end5 P9 B9 |# `* S1 H, D4 M
end
, f5 u" Y+ |; X
) w) V6 D; C8 {begin P_pick3 arriving
6 f9 k1 J* T; i. k9 j9 X+ j    set A_i to 21
5 o9 z+ _0 G5 h% U    move into Q_induct3
! x- M! d8 a+ U    move into pickaisle.induct3
  e2 I8 \& D1 V  X. K' N5 f6 v    while A_i<=30 do begin# B  c* X6 E! A! g& ?1 N8 i1 `
        travel to pickaisle.con(A_i)0 y7 u# m' Z. H6 X. I+ t: M
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: a" @; C& o/ j0 k, `7 f        else wait for 10 sec5 @/ ]+ Y; d5 ]1 |
        if A_i=A_leave then send to die
; U: V* ?* t) U# Y        else inc A_i by 1  c6 `% `, H4 Q( s6 z" [
    end
7 u! n' |, }( I0 x* M' q' q+ rend

最佳答案

查看完整内容

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是个什么东东?$ L' t! S* A# G8 ~  S- k4 D
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
4 H  O& v2 z. l3 y6 C. c+ |. G" \) [. k; q1 M/ |* d. x, Q" l
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
7 K/ v/ B1 P& z4 N. i" U4 C8 {+ D
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
/ ]. k2 s; T. }9 J0 v1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;$ T$ ?- [8 q3 b1 b& }; U
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
: p" S7 \3 ]7 b8 \$ `0 \$ U$ T. |3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
3 Y+ C8 S: l- I" a( |begin P_induction arriving" e* ^3 F/ r4 {9 ?2 [# @# H( x
    clone 1 load to P_pick(A_induct)
1 r+ R  X: l# q3 i+ w, r9 |end最大的系
8 u$ R' O" L' P
; h4 q" \7 n& Z+ G' W9 ebegin P_pick arriving
! P6 y6 F; ]  j1 [; U; z: Y  k    set A_i to procindex * 10 + 17 {# P& E$ z5 e. _2 Q8 ^0 h# W
    move into Q_induct(procindex)
8 f1 D* }8 c! l- H    move into pickaisle.induct(procindex)
2 l5 ]9 x4 H7 Z, q    /*check the type of pickaisle.induct(i), for your last problem.*/
: \% J2 d- s1 z) W& P
# ^/ M& g: l! l6 J- p1 Y: J    while A_i<=30 do begin' D3 E) Q5 T7 ^: t9 I
        travel to pickaisle.con(A_i); D! N2 L0 _0 M1 K. M* m  _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ [4 A$ `& \* ?9 A0 M        else wait for 10 sec
. B- i1 w: `9 N+ R1 g        if A_i=A_leave then send to die; G7 |0 D9 U+ i- Z6 O8 t; ~
        else inc A_i by 1
6 J- s2 ]! T, V/ \5 b6 w    end& j! b" }, l/ [3 p- Y0 F
end
' G" J) t: h# I: t7 U1 c0 n+ |! A+ v3 G
其中的procindex为整形,代表当前process的序号。& D: S3 s( a/ {3 N/ u
station和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-9-3 02:37 , Processed in 0.018539 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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