设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14334|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& C. {" W0 k5 a/ ^/ @0 k7 m* w) g

( A  Y4 x+ ~# 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中的数值,不知道会不会有什么不妥。0 ?% u, |" K- [9 C  o

% U% ^5 H4 Y( E- C+ y% X" Dbegin P_read arriving" u9 S% K5 U3 f$ e, [
    while 1=1 do begin
3 _9 S/ U, l% d0 e6 d0 {5 A6 ]        read A_tote from "data.txt" with delimiter "\n"
: m1 p9 M! b5 |        read A_time from "data.txt" with delimiter "\n"# \$ S" h" R* u. L1 L1 ?* m
        read A_leave from "data.txt" with delimiter "\n"
: k, y9 I" n/ b6 `- H        read A_picks from "data.txt" with delimiter "\n"
  D$ j& ~( `- f6 Q; p% V: [% k        set load type to A_tote- O( S6 B3 Y0 ]& z  t
        if A_tote="tote 1" then set A_induct to 14 V) e' @/ O: Z: `' @; d9 V
        else if A_tote="tote 2" then set A_induct to 2
. [$ K3 V2 @3 i) L" G  @1 ^  I) M            else set A_induct to 3   
: [# o$ n5 E8 ?/ u( _        set A_i to 0
, }& F& F" O' C6 A# F        clone 1 load to P_induction
. n4 Q" t- L8 z        wait for A_time sec
1 s6 s1 x; {: d/ k0 D0 m0 w& s    end
/ |, D# I7 j+ A0 B* Cend
% j2 g4 F; N, a+ i1 |, g, ?9 [, D( y! Z5 H
begin P_induction arriving
/ f. I- J. d' L. j" F    if A_induct=1 then clone 1 load to P_pick1
: c- l% t0 Y9 ~! z! a    else if A_induct=2 then clone 1 load to P_pick2; B: T# c8 ~6 q- N
        else clone 1 load to P_pick3% ~! o9 P7 Y4 \9 Y0 O9 d3 V( Y$ y
end
0 U- H  o8 J6 E/ E- K
* Q! r% }" C8 b  c5 `$ x4 {begin P_pick1 arriving
  C( _, {1 d7 y7 {    set A_i to 1! v8 ]1 ?8 i& l# p- E
    move into Q_induct1  M$ p. ~" [" I( a3 M; v. \* i' P
    move into pickaisle.induct1
8 N- J; y9 A6 {) E6 C    while A_i<=30 do begin7 k8 i5 }( y$ x( c# i4 ]; |
        travel to pickaisle.con(A_i)
8 V- g$ n! v2 |# p( y$ X1 \7 ^9 u" o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 X( l2 K: S" }8 \, y: B        else wait for 10 sec
1 \0 m3 g6 b7 C4 k9 f        if A_i=A_leave then send to die! D! y2 e- y( G& P% q
        else inc A_i by 1- w, {/ r/ N2 J( A. N
    end2 U& Y9 {) y2 j4 `
end3 c! t. }1 X4 e9 }: [
5 n1 \' D( z4 X  g
begin P_pick2 arriving
6 _9 d& n. o' x3 e6 S    set A_i to 112 C  q" B: O% u/ F) Q% c( f: |
    move into Q_induct2
" I9 [: m# v9 y    move into pickaisle.induct2( _; t7 {  ?0 \% j( z( ~
    while A_i<=30 do begin( ^+ Y5 [8 [* g# W4 n5 A$ L. Y+ A
        travel to pickaisle.con(A_i)8 _. M# m! F7 w; |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 l/ y) x( ]# ?3 C7 s
        else wait for 10 sec5 E$ ~# `! R& r3 J) d$ I9 ~; r" w
        if A_i=A_leave then send to die
2 w9 h3 {( B5 V, I        else inc A_i by 1( a7 N; p0 ?& v" w: t- U9 S
    end
  s  ^3 `( t! n3 c8 nend
4 i% P& w9 E' R# F% Y6 C6 s; G8 |% H9 a
begin P_pick3 arriving* @/ {1 O1 h* Y$ h
    set A_i to 21
. [! q3 s8 u& o: ?8 s    move into Q_induct3
4 y8 _; ^  P2 E8 T    move into pickaisle.induct3* q( \+ N/ n7 s& l  ^0 W1 T: |
    while A_i<=30 do begin9 r' y( O( q* D4 X0 z+ S8 E
        travel to pickaisle.con(A_i)% |/ Y  D2 Y5 i1 E/ z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, ^5 [: g' k$ K" g' g8 m
        else wait for 10 sec
7 Z, e7 v! R( O7 O+ v" F, p: o        if A_i=A_leave then send to die
1 j9 @; L! O/ a' g7 \9 P        else inc A_i by 1
) e  O0 @& u  _7 @7 s. j    end; S5 U5 y! D$ ?0 L/ ]* _2 O
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是个什么东东?0 p2 j* C7 t! t5 v/ i2 Y( ^9 o7 u
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
% G# @& @6 ]6 \( C
1 Q$ U4 l5 k6 cAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
! b* X1 R1 P7 w0 K/ c& d  N' b& g( E
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
% K% a" G; ^% L, {1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
8 f; c" |# ~; {& j* V3 V2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
/ w# d" Z# y3 _. M: d3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
& ~1 W( g4 G: ^4 Bbegin P_induction arriving
' s( x- A7 v) s; a    clone 1 load to P_pick(A_induct)6 E! D' l8 i8 s; y8 _' E2 D! S
end最大的系
5 e6 ?) f9 d  {! |3 V1 u9 B+ B+ b: u5 x1 r# n) D
begin P_pick arriving
  ^2 A- v/ P7 X. Q% y    set A_i to procindex * 10 + 1# n' \9 s+ P3 K9 c: Z
    move into Q_induct(procindex)
8 P0 j' G% a3 q8 \1 Q    move into pickaisle.induct(procindex)
0 _# {# F  T9 p9 _8 J8 h    /*check the type of pickaisle.induct(i), for your last problem.*/
* Y/ \- @. B( X$ i$ d5 j
% A  s1 [7 w1 b. j- O! C    while A_i<=30 do begin
) N- ]  W. j0 Y% C        travel to pickaisle.con(A_i)
! a3 `+ K1 d1 [0 R$ F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' E7 d' [: ?0 u$ z" @: ~
        else wait for 10 sec
/ ]4 K) @, J6 {% |7 t2 V7 b0 T        if A_i=A_leave then send to die% a; [5 A8 U9 z$ K
        else inc A_i by 1% V: a5 T/ {& D  U! ?
    end
8 d+ d# _/ c9 `: b9 Xend3 l# k9 P, Y% T2 ^7 i/ I

) F; w& [  f- c& g, _其中的procindex为整形,代表当前process的序号。8 K# G0 Q1 X: E) |5 t2 h% x* ]
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-7-4 01:13 , Processed in 0.016431 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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